Var substitution in awk - not working as expected

countA=`awk '/X/''{print substr($0,38,1)}' fName | wc -l`
countB=`wc -l fName | awk '{print int($1)}'`
echo > temp
ratio=`awk -va=$countA -vc=$countB '{printf "%.4f", a/c}' temp`

After running script for above I am getting an error as :

awk: 0602-533 Cannot find or open file -vc=25.
The source line number is 1.

Same kind of script is working elsewhere. Not sure why its going wrong.

This might have something to do with which awk you are using. Try using nawk instead of awk in your script - especially if it is Solaris.

I am using AIX environment.

did nawk work ? also try gawk