LinuxQuestions.org
Visit Jeremy's Blog.
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 06-22-2012, 03:04 PM   #1
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 203

Rep: Reputation: 26
How to decide when to use what scripting language


Hi everyone!
As a Linux newbie I've had some experience with 2 scripting languages so far, namely BASH and Python.
I would like to know which one you would recommend (and why). I think this must depend on what I will be doing - 75% sysadmin jobs and 25% web development.
Thanks in advance!
 
Old 06-22-2012, 03:10 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,774
Blog Entries: 1

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
Python.

Caveat: bash scripts can *sometimes* be more portable from one system to another. And Python does not come pre-installed on some systems.
 
Old 06-22-2012, 04:36 PM   #3
limescout
LQ Newbie
 
Registered: Jun 2012
Distribution: Arch
Posts: 1

Rep: Reputation: Disabled
I'd recommend Python for anything working with files of data. It's got great regexp support and it's file reading functions are very straightforward. I understand Python works great with the web as well.

For anything involving other programs on the system, pipes, etc. BASH is usually better. You could always do an os.system() to get similar functionality in Python though.

I think it ultimately depends on what you're more comfortable with. For the web stuff, Python is definitely the way to go though.
 
Old 06-22-2012, 04:43 PM   #4
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
COBOL with FoxPro for the win!

But yea Python is what I use for most everything. I use bash for quick jobs or quick script of a sys admin task that I want to automate but thats about it.
 
Old 06-22-2012, 10:17 PM   #5
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 203

Original Poster
Rep: Reputation: 26
Thank you guys for your suggestions. I will have to take a closer look at Python then!
 
Old 06-23-2012, 05:19 AM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,243

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
Best tool for the job at hand is generally the best way to look at things.
 
Old 06-24-2012, 11:25 AM   #7
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Assuming you know the languages well, then it should usually be fairly obvious which one is most appropriate for the job at hand.

If you can't easily decide which one would better suit a particular job, then it likely doesn't matter very much, and you should be able to simply pick whichever one you prefer working in.
 
  


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
What scripting/language to focus on? sambuca Linux - Newbie 3 04-26-2010 02:40 PM
Which is the best scripting language? kike_coello Programming 22 07-25-2009 06:16 PM
Best scripting language? walterbyrd Linux - Software 2 01-08-2006 03:13 PM
Which Scripting Language? birdseye Programming 2 10-03-2005 10:54 AM
Favorite scripting language rverlander General 8 09-02-2002 06:06 AM


All times are GMT -5. The time now is 10:41 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration