I have du -sh
output saved to txt file:
2.1G /home/x/sample/2GB/
101M /home/x/sample/100MB/
...
What I want is to multiply each value in the first column by a value taken from variable depending on the unit. So if for instance unit is G then multiply by $G and append the the result at the end of each line. How to do this in Bash?