LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-04-2018, 08:11 AM   #1
sabaton
LQ Newbie
 
Registered: Apr 2018
Posts: 6

Rep: Reputation: 0
Question System administration - best scripting language to start out with?


Hi,

This is a question to Linux system administrators from an aspiring sysadmin currently preparing for formal training in the field.

My question pertains to scripting languages. I'm mainly focusing on improving my Bash skills and the training will also involve PowerShell since it doesn't focus exclusively on Linux. They don't teach any of the "Big Three" - Python, Perl, and Ruby - which is why I'm thinking of learning one of them on my own. I've dabbled with all three.

That said, I'm a bit confused as to what scripting language other than Bash would make the best choice. Job vacancies for junior Linux system administrators usually mention the "Big Three" (apart from the ubiquitous Bash, of course) but rarely require knowledge of a specific scripting language. They simply either demand or prefer that you be familiar with at least one of the Big Three.

Which leads me to wonder which of those, in 2018, may be the best choice. I've dabbled with all three. I like Ruby and Perl most, although Python comes up somewhat more often than Perl or Ruby. I've been looking around online for answers but most discussions I find on the topic are dated.

Having said that, would it be worthwhile starting to learn one of them on my own or would it be wiser to just focus on mastering Bash and waiting until I actually start out working in the field to learn a scripting language based on what's needed on the job?

Thanks!
 
Old 08-04-2018, 08:23 AM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,258
Blog Entries: 3

Rep: Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713
Quote:
Originally Posted by sabaton View Post
Having said that, would it be worthwhile starting to learn one of them on my own or would it be wiser to just focus on mastering Bash and waiting until I actually start out working in the field to learn a scripting language based on what's needed on the job?
Don't worry as much about Bash for scripting as POSIX shell. Whenever possible, stick to clean POSIX and use bashisms sparingly or not at all.

After that learn AWK. If you have some programming background you can pick up AWK in an afternoon of concentrated study. Then a few more and you'll be comfortable.

Ruby is not relevant to system administration, but perl5 is. That will take some time to be comfortable with. It's main strength is text manipulation and pattern matching. It's good for rapid prototyping but also apparently actually fast at run time. There are an increasing number of anecdotes surfacing of perl re-implementations of C applications being faster, at least in the area of text processing. Logs are text.
 
1 members found this post helpful.
Old 08-04-2018, 10:44 AM   #3
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan with some Tiny Core, Fatdog, Haiku, & BSD thrown in.
Posts: 5,442

Rep: Reputation: Disabled
Agree - shell/awk/perl
 
1 members found this post helpful.
Old 08-04-2018, 11:08 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,553

Rep: Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946Reputation: 7946
Quote:
Originally Posted by sabaton View Post
Hi,
This is a question to Linux system administrators from an aspiring sysadmin currently preparing for formal training in the field.

My question pertains to scripting languages. I'm mainly focusing on improving my Bash skills and the training will also involve PowerShell since it doesn't focus exclusively on Linux. They don't teach any of the "Big Three" - Python, Perl, and Ruby - which is why I'm thinking of learning one of them on my own. I've dabbled with all three.

That said, I'm a bit confused as to what scripting language other than Bash would make the best choice. Job vacancies for junior Linux system administrators usually mention the "Big Three" (apart from the ubiquitous Bash, of course) but rarely require knowledge of a specific scripting language. They simply either demand or prefer that you be familiar with at least one of the Big Three.

Which leads me to wonder which of those, in 2018, may be the best choice. I've dabbled with all three. I like Ruby and Perl most, although Python comes up somewhat more often than Perl or Ruby. I've been looking around online for answers but most discussions I find on the topic are dated.

Having said that, would it be worthwhile starting to learn one of them on my own or would it be wiser to just focus on mastering Bash and waiting until I actually start out working in the field to learn a scripting language based on what's needed on the job?
I agree with both Turbocapitalist and fatmac...but I'll just say "use what you are comfortable with". At the end of the day, if YOU are the administrator, then you have to have something you know how to work with, to get the job done quickly. There isn't a programmer/administrator alive who would do the same thing as another programmer, to get a problem solved. Administration tasks aren't any different...scripting solutions that WORK is what's important.

If it takes you 10 minutes in bash, and an hour in python, then python isn't what you should use. Another admin may be reversed...start with what you know, and build on it.
 
2 members found this post helpful.
Old 08-04-2018, 06:06 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Quote:
Originally Posted by Turbocapitalist View Post
If you have some programming background you can pick up AWK in an afternoon of concentrated study.
I must be the dumbest smuck on the planet ...
 
1 members found this post helpful.
Old 08-05-2018, 12:23 AM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,258
Blog Entries: 3

Rep: Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713Reputation: 3713
Quote:
Originally Posted by syg00 View Post
Quote:
If you have some programming background you can pick up AWK in an afternoon of concentrated study.
I must be the dumbest smuck on the planet ...
I deliberately left out "mastering AWK" from that plan but plead guilty to not clearly refering to the basics. Once can definitely pick up enough AWK in a short time to be really very useful.
 
Old 08-05-2018, 01:29 AM   #7
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,708

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
Quote:
Originally Posted by syg00 View Post
I must be the dumbest smuck on the planet ...
Or one of...I concede that I've not managed to grok awk to date...and that's over many, many years.
 
Old 08-05-2018, 10:55 AM   #8
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Location: Non. Je suis propriétaire – No. I am an owner.
Distribution: Apple-selling shops, markets and direct marketing: customers find the farm and buy apples.
Posts: 1,608
Blog Entries: 40

Rep: Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796Reputation: 796
This type of question in an international Internet-Forum, presented to the mixed audience that we are, does not make much sense, I am afraid.
  • Administration” is not defined, and thus the objectives are not clear.
  • Best” cannot be the attribute of anything which has to respond to a bunch of changing, emerging, disappearing and unperceived claims and requirements.

I feel good, using my languages. So, mine must be the best, which is basically the same as any other kind of response that you can get.

Choose for an audience the guys and gals, that you have to respond to, in your job and whatever kind of clientele might have to take a look at your code, once in a while. They know the BEST of all answers EVER!

Last edited by Michael Uplawski; 08-05-2018 at 10:58 AM.
 
1 members found this post helpful.
Old 08-05-2018, 08:19 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
When working in bash, it's definitely good to be able to use one-liner (simple) awk or sed tricks; makes extracting info easier.
See google for many many examples.

For deeper stuff, python or perl is traditional.
I haven't seen it done in ruby but some people may.

As above, use whichever you feel confortable with.
FWIW, the extensive Perl docs/books do include Perl book for SysAdmins http://shop.oreilly.com/product/9781565926097.do
There are many other useful links on google, as Larry Wall (the inventor of Perl) invented it originally for Sysadmin work & it's been around for many years.
Stick to v5.x https://perldoc.perl.org/
 
1 members found this post helpful.
Old 08-06-2018, 03:42 PM   #10
sabaton
LQ Newbie
 
Registered: Apr 2018
Posts: 6

Original Poster
Rep: Reputation: 0
Hi guys,

Thanks a lot for sharing your thoughts and advice! Much appreciated.

I've been reading up on AWK and it sure looks worthwhile learning at least the basics. I did come across AWK in other discussions but never took the time to look into it.

When it comes to the "Big Three", I think I'll go for Perl. It seems to make sense for an absolute beginner as myself and I've dabbled with it more than with the other two. And as someone who appreciates flexibility, I also rather like its motto "There's more than one way to do it" as opposed to that of Python. But that's just my personal preference.

That said, I do agree with Michael that it's all pretty relative and what matters is getting the job done. At least, that's how I interpreted it. I just needed some pointers to help me decide and that's what I got.

Thanks again!
 
Old 08-08-2018, 11:22 AM   #11
netjess
LQ Newbie
 
Registered: Aug 2018
Location: Oklahoma
Distribution: Ubuntu
Posts: 4

Rep: Reputation: Disabled
If I suggested one in would be Perl. You can make system scripts or websites with it. See OTRS helpdesk system, written in Perl. As far as job market I think it has the most potential as well. Currently anyway.
 
Old 08-08-2018, 05:00 PM   #12
sabaton
LQ Newbie
 
Registered: Apr 2018
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by netjess View Post
See OTRS helpdesk system, written in Perl.
Didn't know it was written in Perl! Interesting. Thanks.
 
  


Reply


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
Which scripting language to learn for Linux Administration huracan10033 Programming 7 05-29-2011 09:15 AM
System Administration scripting diamond_D Linux - Newbie 3 01-11-2011 01:52 AM
linux system administration including network administration linux_linux Linux - Hardware 3 03-15-2008 10:07 PM
LXer: System Administration Toolkit: Distributed administration using SSH LXer Syndicated Linux News 0 08-15-2007 07:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:20 AM.

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