You are not logged in.
Pages: 1
Hello,
I'am new to linux. I was looking on the bash commands and in one example of awk I think there is an error.
This program prints the total number of bytes used by FILES.
ls -lg FILES | awk '{ x += $5 } ; END { print "total bytes: " x }'
It was showing me lenght of 2007 bytes for a file. But it's an year and I think it should be $4 instead of $5.
Offline
It works for me !
If you just run ls -lg what does the output look like?
--col1----col2--col3--col4---col5--col6--etc
-rw-r--r-- 1 simon simon 18365 28 Aug 2006 list.txt
Offline
this is my output for command ls -lg skuska :
-rw-r--r-- 1 duncan 0 2007-06-12 14:30 skuska
Offline
OK this must be a locale difference, so yes $4 would be right for you
Offline
Pages: 1