News for hackers. Stuff that matters.
Re:Show HN: Rb – Turns Ruby into a command line utility by asicsp on Tuesday August 14, 2018 @02:17AM (#17755924)
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'

There are no comments on this comment yet.