Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-26-2008, 01:11 PM   #1
LQ Newbie
Registered: Oct 2008
Location: Sussex, UK
Distribution: fedora
Posts: 6

Rep: Reputation: 0
Which scripting language to learn

Say a person is working towards becoming a Redhat Systems Administrator/Engineer, and as required/advertised for many jobs in this role, needs the abiltiy to write scripts for administrative purposes.
Which language would be the best to learn (first) bash/perl/python .
I have seen advice that suggested it might be better to learn python rather than bash.
If the role were to cover web administration, then perl or php would also be required. Could learning perl cover both system and web administration purposes.

Many thanks for any replies.
Old 11-26-2008, 01:15 PM   #2
Senior Member
Registered: Sep 2004
Location: Nashville
Distribution: Manjaro, RHEL, CentOS
Posts: 2,098

Rep: Reputation: 102Reputation: 102
Yes perl would be a good one to learn but I still feel bash would be a really great first scripting language to use. This is do to much of your system using bash scripts. IE startup and Shutdown scripts, and some in your /sbin are nothing more than bash scripts. So I am going to Say go bash first then look at what is needed in your area. In my area I hear bash / perl and or php.
Old 11-26-2008, 02:26 PM   #3
Senior Member
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,093

Rep: Reputation: 197Reputation: 197
I've been increasingly responsible for administering Linux machines for a living for about six years. I don't know Python. Perl I've only start fiddling with in the last couple of days because I need a script to parse XML and bash is no good for that. I can handle PHP but have never used it for any sort of admin purpose, only for web content generation and then nothing to do with my job. What I use at work every single day is bash. The Linux machines I look after contain a bunch of useful scripts users can use to achieve various things from setting up Thunderbird for use with our email system with a few mouse clicks to resetting their KDE settings back to the defaults and they're all bash scripts. bash is what you have when you're at a command prompt so it really is the one to start with. You can do a lot of stuff simply by piping the output of one command in to another (then that in to another, to another and to another if needed). You can easily give your scripts a simple GUI interface using programs like kdialog.

Beginners Guide:
Old 11-26-2008, 02:43 PM   #4
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Rep: Reputation: 111Reputation: 111
in regards to piping output using bash, you then have to have working knowledge of 'sed' and '(g)awk' (assuming you need any type of string manipulation beyond the capability of bash variable substitution methods) Knowing 'bash' simply isn't enough. You have to know the basic programs available to you (which I'm sure you will find out all the details of with any type of training manual/course). Most definitely, learn bash's variable substitution methods before touching sed and gawk. You can avoid using either of those in some cases.
Old 11-26-2008, 02:47 PM   #5
Senior Member
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,093

Rep: Reputation: 197Reputation: 197
Good point about sed and (g)awk. The bash guides I linked do cover both of those to some degree.
Old 11-26-2008, 03:18 PM   #6
Senior Member
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,260

Rep: Reputation: 318Reputation: 318Reputation: 318Reputation: 318
+1 for bash, sed and awk.
Old 11-26-2008, 07:46 PM   #7
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,411

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Definitely learn bash, its the cmd line default. Also at least the basics of sed/awk or have a good ref handy.
For more powerful stuff, Perl is very popular. There's even an O'Reilly book 'Perl for System Administration'

You can also do web content with Perl, or use php.

Here's a few links:

good luck
Old 11-27-2008, 06:04 AM   #8
Senior Member
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,064

Rep: Reputation: 894Reputation: 894Reputation: 894Reputation: 894Reputation: 894Reputation: 894Reputation: 894
There are various things that you might want, but you will need at least simple bash scripting.

You could say I'm prejudiced because I like Python, but, irrespective of that, I think in your situation, you should learn at the very least some basic bash first. There are some circumstances in which bash (plus sed, grep, awk, as mentioned earlier) is the only reasonable solution for a sys admin, so really the question is, what to do after that; "advanced" bash, Perl or Python? You'll get people arguing for each and none of them is bad. Maybe you'll have developed your own preference by then.
Old 11-27-2008, 10:29 AM   #9
LQ Newbie
Registered: Oct 2008
Location: Sussex, UK
Distribution: fedora
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks a lot Guys. This puts things completely into perspective. Very much appreciated.
Old 11-27-2008, 10:35 AM   #10
Registered: Nov 2004
Location: Maryland, USA
Distribution: Mint 13
Posts: 276

Rep: Reputation: 31
I'll put my vote in for bash as well. There's so much admin work that can be accomplished with bash. Then when you are comfortable at least with the basics, move onto Perl or Python.
Old 11-27-2008, 01:04 PM   #11
Registered: Aug 2006
Location: Saint Paul, MN, USA
Distribution: {Free,Open}BSD, CentOS, Debian, Fedora, Solaris, SuSE
Posts: 730

Rep: Reputation: 75

Any of the references cited for bash, and, if you want a smattering of many, with examples that you can enter and test:
Title: UNIX(R) Shells by Example
Subtitle: ... guide to the C, Bourne, and Korn Shells plus Awk, Sed, and Grep
Author: Ellie Quigley
Edition: 4th
Date: 2004
Publisher: Prentice-Hall
ISBN: 013147572X
Pages: 1200
Categories: sh, csh, ksh, grep, sed, awk, scripting, shell, programming
Comments: 4.5 stars, 50 reviews Amazon (2008.11)
Comments: ( I have 2nd Ed, 1997; 4th covers also bash )
Best wishes ... cheers, makyo
Old 11-27-2008, 01:47 PM   #12
LQ Newbie
Registered: May 2006
Posts: 1

Rep: Reputation: 0
One more for bash, but perl over sed/awk

I agree that bash is essential to any system administration task. It is the natural extension of the command line you use all the time, and uses all the same constructs, commands and environments. So start there.

However, if you want to massage text, don't waste your time with sed and awk. They are too "awk"ward, hard to learn, limited, etc. Perl is easier to learn and use, and far more powerful, and the available library packages lend themselves to solving lots of problems that sed/awk never could. Perl uses all of the "regular expression" power of sed and awk, and then some, but goes far beyond them. I use either bash or perl almost all the time for any system administration job.

Perl follows very closely and further enables the Unix "tool" philosophy of small tools that can be piped together to accomplish bigger jobs, operating on standard text data in the pipeline, as sed and awk do. But it adds much more flexibility and power.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the best programming language to learn jax8 Programming 25 04-04-2010 11:21 AM
What was your first language to learn? vashsna Programming 21 06-11-2007 08:04 PM
what language is best to learn io13 Programming 4 07-09-2006 10:17 AM
What Language Should I Learn? KungFuHamster General 45 04-25-2006 03:10 PM
Which C language to learn? Heiland Programming 10 08-14-2005 09:03 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:38 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration