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, 02:04 PM   #1
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205

Rep: Reputation: 27
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, 02:10 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
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, 03: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, 03:43 PM   #4
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
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, 09:17 PM   #5
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205

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

Rep: Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196
Best tool for the job at hand is generally the best way to look at things.
 
Old 06-24-2012, 10:25 AM   #7
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
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 01:40 PM
Which is the best scripting language? kike_coello Programming 22 07-25-2009 05:16 PM
Best scripting language? walterbyrd Linux - Software 2 01-08-2006 02:13 PM
Which Scripting Language? birdseye Programming 2 10-03-2005 09:54 AM
Favorite scripting language rverlander General 8 09-02-2002 05:06 AM

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

All times are GMT -5. The time now is 03:34 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
Open Source Consulting | Domain Registration