4 ms·
You can get the loop behaviour with ruby $ echo -e $'line one\nline two' | ruby -ne 'puts $_.split(/\W+/)[1]' one two
by ollysb 8y ago
You can get the loop behaviour with ruby
$ echo -e $'line one\nline two' | ruby -ne 'puts $_.split(/\W+/)[1]'
one
two
- fl0wenol 8y agoruby's -n and -p options are venerable equivalents to perl's options which were present in version 1.0 waaay back in 1987 and they were there so it could be that drop in replacement for awk ruby inherited a lot of structure and ideas from perl which it inherited from awk and that thought makes me irrationally happy