System administration - best scripting language to start out with?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
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.
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/
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.