From: Derek Smith Date: 2009-12-23T23:35:44+09:00 Subject: Re: awk print $4 in ruby (rkumar) Sentinel wrote: > Derek Smith wrote: >> Hi All, >> >> I had played in Ruby a while and could not get this to work. >> >> df -m >> Filesystem 1M-blocks Used Avail Capacity Mounted on >> /dev/concat/v109-v112a 7931 2619 4677 36% / >> >> [root@vr /usr/local/vrep/OS_scripts]# df -k |awk '{print $4}' >> Avail >> 4789776 > > Is this what you want ? > > df -k | ruby -lane 'print $F[3]' yes and no. I prefer it in script form no CLI form. dfstr = Array.new dfstr << %x(df -m) dfstr.each do |line| ????? end -- Posted via http://www.ruby-forum.com/.