The best scripting/programming langauge for UNIX/Linux SysAdmins
brian_s 270002K5X3 Comments (4) Visits (9275)
There are so many options out there for scripting and programming languages. As a UNIX/Linux SysAdmin which is best for you?
In my opinion, this is a very simple answer. As a System Admin, you should be looking for the "lowest common denominator". What I mean by that is the scripting language that will be most likely to be available to you on any system you happen to log in to, be in AIX, Red Hat, Solaris, etc.
It's kind of like the "vi" editor versus "emacs". If your a Sysadmin, there is no question that you should learn and use vi instead of emacs. Vi is the one that is always there, no matter what. You can sit down in front of just about any UNIX/Linux system ever made and use vi. Is it the best editor out there from a usability and technical perspective? Probably not, but it is ubiquitous, and therefor it is the editor of choice and the best one to learn if you are a System Admin.
So if you read about the latest and greatest scripting language such as Ruby and are thinking about investing your time there, you might want to think again. As a System Admin, if you learn a langauge that isn't already installed everywhere you are going to have a hard time using it. If you write an amazing Ruby script but none of your AIX servers have Ruby on them you are in for an uphill battle. It is better to learn a language that is ubiquitous and will already be installed. This way your skills are transferable to any machine you work on, and for any company or client you work for. Your current employer might let you install Ruby or some other scripting language on the servers, but will your next employer allow this? Invest your time in learning a scripting language that you will be able to use under any conditions.
You might be thinking that Shell scripting is the way to go. I've been there and done a ton of shell scripting, and I'm here to tell you it can work but it is difficult and a lot of times it isn't the best tool. If you have to do a lot of text processing or math a Shell script is going to be tough. Also, most companies have a mixture of many flavors of UNIX/Linux and if you have ever tried to write a cross platform Shell script you know that it is extremely difficult. Making it even worst is the fact that platforms like AIX by default only have KSH, and platforms like Red Hat by default only have Bash.
In my experience, the best scripting language that is most likely to be there on any flavor of UNIX or Linux is Perl. It is installed by default in most cases on AIX, Linux, and Solaris. In the unlikely event it isn't installed by default, it will literally run on just about any system or OS you can imagine. Perl has amazing text processing abilities and a huge library of modules that add functionality. One of Perls motto’s is "Easy things should be easy and hard things should be possible". Perl definitely lives up to this.
Here is a quote from Eric S Raymond about the Plan 9 OS (which was developed to be the successor to UNIX, but never took off)
To me, the same can be said about Perl. Is Perl the best language from a technical and usability perspective? Probably not. Are there newer programming languages out there that are better than Perl? Probably. Is Perl still the best language for you to learn as a UNIX/Linux System Admin? Most definitely, because it is ubiquitous and it is a decent programming language, and it has an existing codebase that "is just good enough" so it isn't going away for a long, long time.