I am trying to use awk to sum the outputs from a df –k on second column.
Here is what I have so far:
df -k |nawk 'BEGIN {NR > 1 }{ sum +=$2} END {print "\n Total diskspace in Kbytes: " sum }'
The problem is that this does not seem to sum correctly. It’s missing the last row from the df...
Can someone please tell me how to escape ' in the printf of an awk script.
Here is an example
nawk '{printf("exec dbms_system.SET_BOOL_PARAM_IN_SESSION(%s,%s,\'\n",$1,$2)}' $tracefile >xx
it's the first ' right before the \n" that's blowing up.
Thanks
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.