Hi there
I am trying to add up the disk space used on a remote linux box but am falling at the first hurdle i.e isolating the 'space used' column with df -k on the remote box
if i run this, i get the df -k output as expected
Code:
# rsh remote-server 'df -k|grep sd|grep -v boot'
/dev/sda3 8254272 1672956 6162020 22% /
/dev/sdb4 140258988 13405152 119729012 11% /data
/dev/sda4 123648020 32828 117334180 1% /data1
which is fine, however I want to isolate the third column, so that i can add use some additional logic to add the values to give me a total space used by that box
so i tried
Code:
# rsh remote-server 'df -k|grep sd|grep -v boot|awk {print $3} '
awk: cmd. line:2: (END OF FILE)
awk: cmd. line:2: parse error
I tried using cut, but setting the delimiter to " " (ie space) it messes up all the columns
does anybody have any idea how i can get around this ?
any help would be great