Hi
Where the 'constant' (h) gets assigned it's value?
The h is actually counting the number of folders from other variables.
What do you think the value of '$t' in 'sqrt($t)' is?
Why are you trying "pipe" 'sqrt($t)' into 'bc -l'? Wouldn't a simple 't=sqrt(t)' be enough?
Yeah. I already tried on sqrt(t); which is without bc -l.
You are right. I am using associative array count for the purpose to read each line.
However, when I get the result from the operation, it doesnt return me the correct output from these operation.Did I missed out any "$" in the below fragment of code? It gives me INF and NAN value
cat a.txt| awk ' {
t= h*($3+$2);
s= sqrt($t)
count($1)=$2/s
}
END{
printf("the sqrt of %d is %d\n", $2,$1);
}
Please advise.Thanks.
Rgrds,
Jason