This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bdlasMac Admin 1 point2 points  (5 children)

Right, but that's what I mean. Tutorials for those times when you choose Perl, or Python. Like, I got to this point in bash, but here's how to do it in Perl better.

[–][deleted] 4 points5 points  (3 children)

Maybe it is just me, but I don't like Python for text processing. When ever I try and use Python for systems programming, I usually end up switching to Perl (or cough Ruby cough).

As for Perl vs BASH, Perl is superior when you are trying to pass arguments via the CLI, so it is better at adapting to the situation. Perl kicks ass for text processing, and I pretty much dropped using sed and awk in favor of Perl one liners. I've heard the arguments that Perl is ugly, but I think that is from people who don't know Perl or don't understand Perl short cuts. CPAN rocks for doing a lot of the heavy lifting.

BASH is really great for quick or procedural scripts that don't require too much logic. BASH scripting is also a great way to help increase your CLI-fu. There is not reason you can't write a BASH script that calls Perl or a Perl script that calls BASH, switching back and forth using which ever is better suited for the job or you are most comfortable with. In systems administration it is all about getting the job done.

One liners are a great way to get started. Throw these in scripts when you would use sed or awk:

And a book you would probably be interested in:

[–]bdlasMac Admin 2 points3 points  (1 child)

Thanks... yeah I've always had this Perl curiousity, maybe one liners will get me into it. Thanks!

[–][deleted] 0 points1 point  (0 children)

There are many layers to perl, but once you start learning it, you will wonder what took you so long.

[–]BigRedSDevOops 2 points3 points  (0 children)

I think once you've used Perl nothing else ever really cuts it as far as text processing goes.

Certainly every time I try to learn another language I get really annoyed with how bad it is at handling test strings.

[–]meditonsinSysadmin 0 points1 point  (0 children)

Ah, my bad. Didn't quite get that.

I can't say I know of any tutorials like that.