Linux - SoftwareThis 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
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.
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.
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)
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.
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.
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.
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).
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.