shrinkwrap icon indicating copy to clipboard operation
shrinkwrap copied to clipboard

Changed number formatting in awk (scientific notation caused truncate…

Open ebutusov opened this issue 4 years ago • 0 comments

… to exit with error)

For some reason in Debian Buster (RPI4) awk returns number in scentific notation, e.g.:

#nrasp /home/pi/lab/shrinkwrap # cat /tmp/fdisk_new.log | grep "83 Linux" | awk '{print ($3+1)*512}'

4.5216e+09

This causes truncate command to exit with error, as it doesn't understand the scentific notation. The workaround is simple to use printf with float format (%d - integer is too small) and cut off decimal places.

ebutusov avatar Mar 29 '20 14:03 ebutusov