hello,
can it be used with ENVIRON instead of -v?
# free=50
# size=60
# awk -va=${free} -vb=${size} 'BEGIN{printf "%3.2f\n", a/b*100}'
83.33
# awk 'BEGIN{printf "%3.2f\n", $ENVIRON["free"]/$ENVIRON["size"]*100}'
awk: 0602-562 Field $() is not correct.
The source line number is 1.
#
can it be used with ENVIRON instead of -v?
# free=50
# size=60
# awk -va=${free} -vb=${size} 'BEGIN{printf "%3.2f\n", a/b*100}'
83.33
# awk 'BEGIN{printf "%3.2f\n", $ENVIRON["free"]/$ENVIRON["size"]*100}'
awk: 0602-562 Field $() is not correct.
The source line number is 1.
#