3 ms·
for the 3rd example, not sure why you are manually building the array.. df -h | ruby -e 'puts readlines.drop(1).sort_by { |l| l.split[-2].to_f }' similarl
by asicsp 8y ago
for the 3rd example, not sure why you are manually building the array..
df -h | ruby -e 'puts readlines.drop(1).sort_by { |l| l.split[-2].to_f }'
similarly, the `uniq` example from your other comment could be shortened to
printf 'hello\nworld\nhello\n' | ruby -e 'puts readlines.uniq'