I am on a bash and I am trying two commands with printf, but getting different results
[bhavukg@XYZ unixTutorial]$ printf "Result is %.3f\n", 8/3
Output:
bash: printf: 8/3: invalid number
Result is 0.000
[bhavukg@XYZ unixTutorial]$ awk 'BEGIN {printf "result is %.3f", 8/3}'
Output:
result is 2.667
My questions is why first printf not able to evaluate the expression. What other changes exist in both printf statements