Re:Useful Perl one-liners (2013)
by teddyh on Wednesday November 30, 2016 @12:18AM
(#13068661)
I prefer this, which is shorter than both of those:
[ Parent
| on HN ]
Re:Useful Perl one-liners (2013)
by EvilTerran on Wednesday November 30, 2016 @04:52AM
(#13069543)
Oh, nice! I always forget that xargs defaults to echoing the parameters if you don't specify a command.
That said, variations on my one are also handy for doing any further processing on the lines - eg, I do stuff like this pretty regularly:
perl -ln0e '/^FOO=/&&print' /proc/$pid/environ