News for hackers. Stuff that matters.
Re:Skip grep, use awk by vidarh on Tuesday July 04, 2017 @09:32AM (#14695741)
Here's the equivalent for Ruby:

    alias glorp='ruby -ane '

    $ [data is generated] | glorp ' ~ /Something/ and puts $F[2]'
Or:

    $ echo -e '{"hello":"world"}\n{"hello":"cat"}' | glorp 'puts JSON.load($_)["hello"] ' -rjson

(Of course Ruby got the -a autosplit-mode and the -n assumed 'while gets(); ... end' loop from Perl along with $_ and $F, so it's very intentional that they're similar)
Re:Skip grep, use awk by kolodny on Tuesday July 04, 2017 @11:12AM (#14696316)
Somewhat related nodejs self plug: Use nip https://github.com/kolodny/nip

    $  echo -e 'this\nis\na\nwhatever foo' | nip 'return /whatever/.test(line) && cols[1]' # foo
Re:Skip grep, use awk by Ultimatt on Tuesday July 04, 2017 @09:40AM (#14695788)
Awesome thanks for sharing this! I was too lazy to give a Ruby example alongside.
Re:Skip grep, use awk by jedisct1 on Tuesday July 04, 2017 @12:35PM (#14696798)
And Ruby regexes are amazing.
Re:Skip grep, use awk by omaranto on Tuesday July 04, 2017 @12:40PM (#14696831)
I thought that they were amazing because they were just like Perl's. Are there any differences?