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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-22-2012, 02:04 PM
|
#1
|
Member
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205
Rep:
|
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!
|
|
|
06-22-2012, 02:10 PM
|
#2
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
Python.
Caveat: bash scripts can *sometimes* be more portable from one system to another. And Python does not come pre-installed on some systems.
|
|
|
06-22-2012, 03:36 PM
|
#3
|
LQ Newbie
Registered: Jun 2012
Distribution: Arch
Posts: 1
Rep:
|
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.
|
|
|
06-22-2012, 03:43 PM
|
#4
|
Senior Member
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604
|
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.
|
|
|
06-22-2012, 09:17 PM
|
#5
|
Member
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205
Original Poster
Rep:
|
Thank you guys for your suggestions. I will have to take a closer look at Python then!
|
|
|
06-23-2012, 04:19 AM
|
#6
|
LQ Guru
Registered: Sep 2009
Location: Perth
Distribution: Arch
Posts: 10,017
|
Best tool for the job at hand is generally the best way to look at things.
|
|
|
06-24-2012, 10:25 AM
|
#7
|
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852
|
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.
|
|
|
All times are GMT -5. The time now is 03:34 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|