Scripting language for system admin

Am trying to learn a scripting language to automate mundane system admin tasks. Being a Novice, Just trying to understand, which language would be easier to learn and one for all types.

i.e Perl or Shell scripting. Which of these would be good for a system admin, Database admin ??

pls. post your ideas on this.

Cheers...UBR :slight_smile:

I'd say learn both. Most of my day-to-day automation is done using shell scripting (ksh/bash). Shell scripting is also a must for writing init scripts, etc, and you'll be surprised at how often you'll find yourself using conditional constructs and loops on the command line once you get proficient.

e.g.
for server in $servers; do ssh $server do_something; done
mailq | grep -B1 "Connection refused" | awk '{print $1}' | sed 's/\*$//' | while read id; do qtool -d /var/spool/mqueue/$id; done

You get the idea....

However, when interaction with databases is required, or real heavy duty reporting and text file parsing, I always write in Perl for the sheer flexibility of the language, the rich collection of modules available and the powerful regular expressions at your disposal.

PHP is another good language to pick up later on as you can create administrative web-based interfaces very easily. And a little C is never a bad thing.

and I will add Python, if you have time read why :slight_smile: