LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-23-2009, 10:44 AM   #1
latinmusic74
Member
 
Registered: Jun 2007
Posts: 118

Rep: Reputation: 16
Perl or Shell Scripting


Which language will better to learn for a Linux Administrator job?


Perl or Shell Scripting


Thanks
 
Old 10-23-2009, 10:56 AM   #2
liuguobiao
Member
 
Registered: Dec 2008
Location: china
Distribution: slackware
Posts: 32

Rep: Reputation: 16
I hadn't study Perl ,But in my opinion ,no matter which one ,
If you mastered it and use it to managed Linux well.
Than you will do well in your job. Don't hesitate,just do it.
 
Old 10-23-2009, 12:38 PM   #3
latinmusic74
Member
 
Registered: Jun 2007
Posts: 118

Original Poster
Rep: Reputation: 16
Which one is easy to learn
 
Old 10-23-2009, 01:52 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Which language will better to learn for a Linux Administrator job?
Perl or Shell Scripting
Both, but BASH first. I am not a sysadmin--except on my own systems--but my rationale is simply this: I have installed and configured Linux at least 100 times in the past 5 years, and I have never learned Perl. On the other hand, it's hard to get thru a single day without doing something in the (BASH) shell.

Quote:
Which one is easy to learn?
both, neither, it depends (pick one)
My first "real" language was C. At one time, I knew all the syntax and could actually construct a simple program. With that experience, I find the syntax of Bash + the various utilities to be an ugly convoluted mess. The good news is that you don't need to know all the nuances to get started. More good news: Once you do know some stuff, it's VERY powerful.

Now, set aside all of what I just said.
If you are looking for a job, start by talking to the kind of companies you would like to work for. Find out what kinds of problems they are dealing with and ask them what skills they think are the most important.
If you find a company that you really want to work for, try to get ANY job---sweep the floors if you have to. Once you are inside, it's much easier to make contact with people that do that kind of work that you want to do.
 
Old 10-23-2009, 02:37 PM   #5
Deviathan
Member
 
Registered: Dec 2005
Posts: 52

Rep: Reputation: 18
Both would be good to learn.

I tend to use both in my day to day job duties. I find that it's more convenient to use shell scripts for when I need to run lots shell commands or for wrapping several utilities together into one functional piece.

However, if I need to do alot of text processing or data processing from files or outputs from other programs then I find perl to be easier to do that in.
 
Old 10-23-2009, 06:53 PM   #6
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by latinmusic74 View Post
Which one is easy to learn
if you want easy to learn, learn Python.
 
Old 10-23-2009, 07:14 PM   #7
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Rep: Reputation: 111Reputation: 111
Bash is 100 times easier than Python or any other scripting/programming language. But that's taking into consideration that the power of bash relies upon the pre-compiled binaries of the system instead of the language's library of functions. Because of the power of 'sed' and 'gawk' among other things, bash can be used for small simple execution scripts, to simple decision making scripts to a full on cd auto ripper/namer/tagger (abcde).

You could equally argue that perl and python can do every thing sed and gawk can do, only more intuitive; not to mention executing programs on the system. But what if perl and python are not on the system your are administering? bash (or some other sh type shell) is one thing that's guaranteed to be on all linux systems. Yes yes aside from special one use things like embedded devices.


Really though, it depends on what you are administering. The system in general requires simple scripts best suited for bash. However, if you need to actually make over 10 functions or start thinking about classes in your code, you may consider actually using a language supporting better organization.
 
Old 10-24-2009, 03:01 PM   #8
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
I have a Linux administration job. The machines I manage have loads of scripts on them that I've written to do various things like making sure custom config is in place, ensuring updates get installed (and notifying me if installation of updates fails), and some of them are even there to be run by the users to do something useful. One of these scripts is written in perl as an experiment, the rest are Bash shell scripts.


If you can use the command line you can write a Bash shell script because a shell script is basically just a bunch of commands you could type in at the prompt one after the other all bundled up in to one file for convenience so you can run them all at once. (And so you can run them automatically.) You can even give your shell scripts simply GUI interfaces using tools like zenity, or make them pop up notifications on the screen using libnotify.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Terminal functions for shell scripting with Shell Curses LXer Syndicated Linux News 0 03-26-2008 11:50 PM
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 04:29 AM
perl vs. php shell scripting nouse66 Programming 2 10-06-2005 02:47 PM
shell scripting and perl irubin Programming 1 01-01-2004 08:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:26 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