SPUG:Best One-Liners and Scripts for UNIX

Brian Hatch spug at ifokr.org
Fri Apr 18 08:33:02 CDT 2003



> Ouch! That's too complicated for my "Minimal Perl" tastes.

I just gave you my starting point - of course we can
play with things.

> How about the following as a one-liner to type directly to the shell,
> 	perl -wlna -e 'print "@F[3,1,2]"' file

I use perl one liners on the command line all the time.  But
when I use one too much, then I put it in a function so I don't
need to any more.  That's the whole point.

> unshift @F, "(No zeroth field! first is #1)";

Are you nuts?  That was the whole point of using perl!  Of course
the first field should be field #0.  Anything else is unperlish.

I also wanted the use of the '..' operator - you're not going
to take that away, are you?.

--
Brian Hatch                  Language, it's a virus.
   Systems and
   Security Engineer
http://www.ifokr.org/bri/

Every message PGP signed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/spug-list/attachments/20030418/0d849fbe/attachment.bin


More information about the spug-list mailing list