LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 02-07-2009, 02:45 AM   #1
dnyanesh.3
LQ Newbie
 
Registered: Feb 2009
Location: pune
Posts: 10

Rep: Reputation: 0
which is better perl or shell


Hi,

I want to learn sripting language,which will be the better perl or shell.

thanking you.
 
Old 02-07-2009, 02:54 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,056

Rep: Reputation: Disabled
If you want to administrate your system, begin with the Advanced Bash-Scripting Guide from Mendel Cooper. You will find many other resources on The Linux Documentation Project website.
 
Old 02-07-2009, 04:42 AM   #3
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Depends on what you want to do. Both have their uses. I've been using/administering Linux for years and know virtually no perl as I've always found that scripts I want to write can be done in using bash and the built tools (cat, sed, tax, awk, tr, etc)

The one time I used perl recently was where I needed to parse some xml.
 
Old 02-09-2009, 02:25 PM   #4
GibsoneanNode
Member
 
Registered: Jan 2009
Distribution: Desktop- Debian 4.0
Posts: 43

Rep: Reputation: 16
I am not a programmer so take my advice with faint regard.

dnyanesh.3, I don't suppose you would phrase the question as you did, narrowing the choices down to two, if you hadn't already considered first a broader pool of options?

I comment on this because I found Perl's syntax to be cryptic and the learning of it slow going, at some point unfortunately I stopped trying to learn it. You might take to learning Python, which reads more like spoken language, with greater ease than Perl. Just as arizonagroovejet indicated the programming language that is right for you might be narrowed down by knowledge of your purpose in using it, but I don't think you've disclosed that. Will this be your first programming language?

I am only now just starting to learn Python myself but I feel as though this should have been my starting place with scripting alongside the Bash shell. There are many differences between the scripting languages beyond one's ability to grasp a particular language readily, such differences are noted in some threads I've read recently. I felt Su-Shee's comments in the thread Lisp, Ruby, or python were very insightful, also consider reading I want to script and Which scripting language to learn.

For Python resources consider a page of the Python Wiki.

Good luck with your hunting and I hope you enjoy the language you choose!
 
Old 02-09-2009, 04:49 PM   #5
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
For my own two cents, I know little bash scripting (a deficiency I hope to correct soon), but have been hacking along with perl for some time. Both are powerful, and very configurable, and you'll find individuals on both sides of the argument, I've found it really does come down to personal preference. Perl's syntax makes sense to me (not that bash's doesn't), and I enjoy it's modular customizability.
 
Old 02-09-2009, 07:03 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Well, bash is the shell you login with, so it makes sense to know that language. You can also call awk/sed etc as mentioned.
However, it is interpreted and it can get pretty fiddly/messy if you want to do longer/more complex programs.
See the link in post #2

This is where Perl comes in. Its compiled-on-the-fly and its got the same capabilities as C, but easier to program, with about 80-90% the speed. You don't have to shell out to do stuff, so its a more 'integrated' lang.
Ideally you'd learn both, so you have the right tool for the job.

http://perldoc.perl.org/
http://www.perlmonks.org/?node=Tutorials
 
Old 02-10-2009, 12:27 AM   #7
roy_lt_69
Member
 
Registered: Aug 2006
Location: Vancouver, BC, Canada
Distribution: Slackware, Mint, Debian
Posts: 238

Rep: Reputation: 29
Start off with learning bash.
But be aware that if you plan on doing more complex scripting you may have to learn other languages to extend bash, eg awk, sed, etc.
Perl is rather cryptic, but it has a rich command set and accompanying library to extend it.
It is a full blown computer programming language (with all the bells and whistles) that is great for doing complex administration stuff!
Also Perl will be more portable between *nix flavours compared to bash which can differ!
 
Old 02-10-2009, 02:49 AM   #8
kauuttt
Member
 
Registered: Dec 2008
Location: Atlanta, GA, USA
Distribution: Ubuntu
Posts: 135

Rep: Reputation: 26
Based on self experience:-
start with bash...when I learnt scripting some years back.I found bash more aesy going (though that depends from person to person)...Now I am comfortable with perl..but that time learning perl was hectic, atleast to me as compare to me.

-cheers-
kd
 
Old 02-11-2009, 06:11 AM   #9
dnyanesh.3
LQ Newbie
 
Registered: Feb 2009
Location: pune
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kauuttt View Post
Based on self experience:-
start with bash...when I learnt scripting some years back.I found bash more aesy going (though that depends from person to person)...Now I am comfortable with perl..but that time learning perl was hectic, atleast to me as compare to me.

-cheers-
kd
thanks
 
  


Reply

Tags
better, perl, shell



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
perl or shell question arash8m Programming 4 05-30-2007 08:41 PM
shell and perl scripts srnerkar1 Programming 2 12-03-2005 03:07 PM
Shell Script, C, C++, or Perl ? mrpc_cambodia Programming 5 08-12-2004 10:18 AM
shell scripting and perl irubin Programming 1 01-01-2004 08:27 AM
shell or perl? l_9_l Programming 8 05-10-2002 07:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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