Scripting Languages for Linux System Administration

16 views
Skip to first unread message

Robert V. Bolton

unread,
Oct 14, 2009, 12:35:36 AM10/14/09
to Ogden Area Linux Users Group
I'm thinking about increasing my scripting knowledge and would like to
hear some opinions about scripting languages for Linux system
administration. I've been playing around with Ruby, but most of the
information I find about it focuses on Rails and web development. I
know that Perl is a big in the sysadmin world, but I see that Python
has really caught fire in the last couple of years among sysadmins. So
if I could get a few opinions about why you like <insert favorite
language>, I think it would really help me decide which language to
add to my sysadmin toolbox.

Thanks,
Robert V. Bolton

Joshua Gardner

unread,
Oct 14, 2009, 2:40:05 AM10/14/09
to oa...@googlegroups.com
Perl and Python are widely used for sysadmin work but the language[s] that most system scripting in Linux is done is is shell scripting. Whether bash shell or POSIX-compliant shell (most distros use bash, Debian and Ubuntu use dash which is a POSIX-compliant shell) you'll find that most of your linux system, from the init scripts to the app launchers to the cron jobs is scripted in shell.

By all means you can script in a "real" language if you like, but bash with some of the other gnu tools like sed, awk, grep, cut, sort, and several others is very powerful. Shell scripting is very accessible too. If you know any command line stuff it's natural to move in to scripting eventually, setting up functions and aliases in your .bashrc and eventually writing full scripts. I've seen some very powerful stuff done with shell scripting (abcde, a command-line frontend to cdparanoia and lame for cd ripping is an excellent example).

Myself, when I write a script I generally start writing it in bash, and sometimes move to Python if it gets a bit too complicated or I want to use some specific Python library for something.

But system administration is a very personal thing so it's really a personal choice. Use the language in which you are most comfortable with the syntax, the development environment, and the tools. You could do system scripting in JavaScript (going out on a limb with that one) for all anyone cares. It's your system, after all.

Just my 2¢.

-Josh
--
Society loses the value of things which are uselessly destroyed.
--Frederick Bastiat

GCS/B/M d+ s+ a--- C++ UL++ Py+++ L+++ E- W++ w-- M- PS+++ PE+++ Y+>++ PGP+ t+ R tv- b+ DI++ G e h! r! y-

Brandon G

unread,
Oct 14, 2009, 9:37:39 AM10/14/09
to oa...@googlegroups.com

You /need/ to be good at bourne shell, because it is always there.

Other than that, it is what you are the most comfortable and skilled at
programming. Everything else becomes opinion :)

Personally, my schtick is perl, but I have also been using it since
version 4.0.

-Brandon

Reply all
Reply to author
Forward
0 new messages