LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 05-12-2005, 12:00 PM   #1
s_siouris
LQ Newbie
 
Registered: Nov 2004
Distribution: Scientific Linux 6.4
Posts: 22

Rep: Reputation: 0
bash, perl, or python?


Hello all,
I am planning on spending some time on learning a language to use for simple tasks. I have written shell scripts that save certain settings files to specified directories, scripts that synchronize directories between pc's, shell scripts for latex docs, such as for word counts, scripts that rename files, etc.....
I have found that as time passes, I am writing more and more complicated scripts, and I am wondering if I should be spending my time learning python or perl rather than bash. As I am a mechanical engineer, I cannot afford the time to learn all three languages and then decide which one is best for my every day tasks.

My question is on which scripting language do you think is best for every-day linux administration tasks (like the ones stated above)? or even what do you think the strengths of bash, perl, and python are? (looked on the internet but couldn't find a comparison of these scripting languages)

Cheers
Spiros
 
Old 05-12-2005, 12:37 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
My vote would be to learn perl, well known, lots of support.. etc. More powerful than bash but bash is perfect for the small simple tasks, if your scripts are getting more complicated, use perl.
 
Old 05-12-2005, 12:40 PM   #3
Leldorion
LQ Newbie
 
Registered: Nov 2004
Posts: 11

Rep: Reputation: 0
I couldn't find much comparisons with bash...but I did find plenty of perl/python stuff.
This seems like a good run down.

Last edited by Leldorion; 05-12-2005 at 12:42 PM.
 
Old 05-12-2005, 05:57 PM   #4
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Python can be used for small task and tasks as complex for gui programs writing. Python is a good language that starts you off to use other programming langauges. Though, it could not hurt to learn Perl.
 
Old 05-13-2005, 04:50 AM   #5
freakyg
Member
 
Registered: Apr 2005
Distribution: LFS 5.0 and 6.1
Posts: 705

Rep: Reputation: 30
Ya, stay with learning Perl and Bash........

there is no real use for python in the Real world...
 
Old 05-13-2005, 05:14 AM   #6
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 57
Quote:
Originally posted by freakyg
Ya, stay with learning Perl and Bash........

there is no real use for python in the Real world...
Heh, with the risk of starting a Holy War I would like to say the opposite. Perl is very useful but it's a pain to use IMHO. Python allows for quickly writing advanced programs and it is easy to understand a program somebody else has written. Perl is known for allowing pretty much anything so everyone has their very own style, making maintaining an application someone else has written (in Perl) a huge pain.

It all comes down to preference though. Have a look at both Perl and Python and see which one suites you best. And knowing both doesn't hurt either.


Håkan
 
Old 05-13-2005, 05:54 AM   #7
s_siouris
LQ Newbie
 
Registered: Nov 2004
Distribution: Scientific Linux 6.4
Posts: 22

Original Poster
Rep: Reputation: 0
thanks for your replies.
I actually should've mentioned that I do know how to get around C and FORTRAN (along with OpenMP and MPI API's for parallel processing) but only for numerical computations.
I do appreciate the comments like"knowing both is better", but you have to consider than I am not a computer scientist or working in a related are, as (I assume) most of you are. And for this reason I simply do not have the spare time to devote time in both. I am just looking for a language for every-day scripts, without being very limiting should I wish to do something more complicated (but again, only for every-day administration of my box).

Spiros
 
Old 05-13-2005, 06:42 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,491

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Quote:
Originally posted by freakyg
Ya, stay with learning Perl and Bash........

there is no real use for python in the Real world...
Say what ???.
I went through all this not so long back.
Python did all I could ask, and more - still learning.

Hey freakyg, go have a look at planet.perl.org
Quote:
This site is powered by Python (via planetplanet)
Ahhhh, you've goota love these type of thread - they always degenerate into "religious wars" amongst the various believers...

s_siouris, just spend a little time checking each out, then bite the bullet, and pick one.
Then stick with it - really you can't go wrong if you put the time in to learn it, rather than chopping and changing.

Last edited by syg00; 05-13-2005 at 06:47 AM.
 
Old 05-13-2005, 06:43 AM   #9
slackie1000
Senior Member
 
Registered: Dec 2003
Location: Brasil
Distribution: Arch
Posts: 1,037

Rep: Reputation: 45
hi there,

sorry could no stand this statement...

Quote:
Originally posted by freakyg
there is no real use for python in the Real world...
from gentoo.org portage introduction...
Quote:
Portage is completely written in Python and Bash and therefore fully visible to the users as both are scripting languages.
we are talking about one of the best package management systems ever built...
now... what you call real world??

regards
slackie1000
 
Old 05-13-2005, 09:51 AM   #10
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Quote:
Originally posted by freakyg
Ya, stay with learning Perl and Bash........

there is no real use for python in the Real world...
Really? I think Google, Yahoo, and Industrial Light & Magic would disagree. Perhaps these companies exist in the "fake world".

Anyway, I think python is easier to learn then perl and more powerfull then bash. So my skewed suggestion is python.
 
Old 05-13-2005, 11:21 AM   #11
jonlake
Member
 
Registered: Apr 2004
Distribution: Slackware 11.0, Gentoo
Posts: 252

Rep: Reputation: 31
As you can probably tell, between python and perl it is a prefernence thing (for the most part). I know you don't have time to learn the both of them, but take a quick look at both of them and then you may be able to determine which one will suffice. You defenitely came to the right spot as there are many opinions being thrown around.
Also, check out what kind of support each has, (web sites, forums, etc). That may help you make up your mind.
 
Old 05-13-2005, 04:15 PM   #12
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760
Blog Entries: 4

Rep: Reputation: 77
My 2 cents:

I started programming just a couple years ago, and like you I started with BASH and soon wanted more power...

I had a look at both python and perl. Today I am quite productive with python, as it is very easy to learn and has a very easy to understand syntax. Perl however, still manages to baffle and confuse the hell out of me when even attempting the simplest of tasks.
 
  


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
Advice on PERL vs. Python servnov Programming 5 10-02-2005 03:59 PM
Python or Perl? Boby Programming 2 06-12-2005 11:54 AM
Perl or Python JJX Programming 6 10-27-2004 04:58 AM
Perl or Python ! linuxlover1 Programming 13 04-19-2004 08:33 AM
Perl or Python to C++ compiler JHuizingh Programming 0 07-16-2002 12:36 PM


All times are GMT -5. The time now is 05:16 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration