I was not well for the past 4 days ,today only came to work.
Thank you for the script.
the awk script is working fine,if i excuted alone as you said.
I declared the filed 1 filed 2 filed 3 in th shell script and pass the field 1 and filed 2 filed 3 values as a parameter in to the awk script then it's failing.
i decared the values in the shell script like
sum=50
passed=30
failed=20
Hi,
if you already using a script which stores
values in variable like sum, passed, and failed.
add these lines
exp1=$sum*100/$failed
echo the failed percentage is 1 expr $exp1 | bc `
similarly do for pass percentage
and be carefule, the characters are not single quotes but the one above tab key.
write back if problem persists
there are two similar looking characters one is ' and another `
use the latter one.
i don't know what it is called; it shares key with tilde (~).
now that should work
lready using a script which stores
values in variable like sum, passed, and failed.
add these lines
exp1=$sum*100/$failed
echo the failed percentage is ` expr $exp1 | bc `
similarly do for pass percentage
and be carefule, the characters are not single quotes but the one above tab key.
expr $exp1 | bc should be enclosed between ``
expr is for calculation of expression passed to bc
and the result is echoed on screen.