Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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'


Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: