|
|
Log in / Subscribe / Register

My sysadmin toolbox (Linux.com)

Linux.com has another list of favorite sysadmin tools. "If the Internet is the Information Superhighway, then Perl is the Fix-a-Flat and the spare tire -- and the spare drive-shaft, should you need it. Anything you can do in a shell or sed or awk script, you can do in Perl. With the -ne options, you can iterate automatically over every line of input in a pipe chain."

to post comments

My sysadmin toolbox (Linux.com)

Posted Jan 27, 2006 23:21 UTC (Fri) by cantsin (guest, #4420) [Link] (4 responses)

cat /etc/passwd | perl -ne 'print if $_=~/daemon/'
"grep daemon /etc/password" seems easier to me...

My sysadmin toolbox (Linux.com)

Posted Jan 28, 2006 1:07 UTC (Sat) by robla (guest, #424) [Link] (1 responses)

Yeah, it is, and I generally use plain ol' grep for simple stuff. However, a couple of things to note:

1. That line could be much easier:
perl -ne 'print if /daemon/' /etc/password

2. If you're like me and only have room in your head for one regular expression syntax, perl regexps are a pretty good choice to learn. I can never get egrep regexps right, but because I know how to use perl as a grep replacement, I generally don't have to.

My sysadmin toolbox (Linux.com)

Posted Jan 29, 2006 16:09 UTC (Sun) by r55man (guest, #21903) [Link]

Try grep -P.

My sysadmin toolbox (Linux.com)

Posted Jan 29, 2006 16:58 UTC (Sun) by Baylink (guest, #755) [Link]

Dammit, Jim; he's a sysadmin, not a writer!

But I think he sort of missed out, because of that, on making an important point: in his first item, when he lauds pipes, and shows a line-and-a-half long pipeline...

I hope he's put that in a script.

I usually do that the second time I use something; the first time, if I think I'll do it again. The ability to create scripts to do things you do frequently is *so much* the essence of *nix sysadministry, that I think I'm going to write them a piece myself, and include my top 10 favorite personal scripts.

My sysadmin toolbox (Linux.com)

Posted Jan 29, 2006 19:10 UTC (Sun) by sholdowa (guest, #34811) [Link]

grep ^daemon: is better... yes I hve been caught in similar situations (:

Perl---wooowooo!!!

Posted Jan 28, 2006 2:35 UTC (Sat) by ccchips (subscriber, #3222) [Link]

Actually, it's the one language I've been able to get away with using in a heavily Windows-oriented shop publicly (no Python or Ruby or any of that) publicly. VB is ubiquitous, but it'll never get the level of respect Perl does among the knowledgeable.

Not to mention you can pick up 100 bags of groceries with one hand.....

CPAN keeps me coming back

Posted Jan 30, 2006 17:55 UTC (Mon) by b7j0c (guest, #27559) [Link]

when it comes to solving real problems, CPAN continues to tip the odds in favor of perl - rarely do i find myself needing advanced OO or other language features - what i really want is for someone to abstract the details of some problem domain i need to interract with but can't be bothered to fully understand at a low level - like the del.icio.us api or mysql etc.

while i too am upset that perl6 is still in development, the good news is that perl5 is also in active development and numerous real improvements are being pushed out for the huge existing userbase. perl 5.9 was recently released and the delta log lists a big number of nontrivial improvements.


Copyright © 2006, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds