Linux - NewbieThis 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.
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.
Depends on what you want to do. Both have their uses. I've been using/administering Linux for years and know virtually no perl as I've always found that scripts I want to write can be done in using bash and the built tools (cat, sed, tax, awk, tr, etc)
The one time I used perl recently was where I needed to parse some xml.
I am not a programmer so take my advice with faint regard.
dnyanesh.3, I don't suppose you would phrase the question as you did, narrowing the choices down to two, if you hadn't already considered first a broader pool of options?
I comment on this because I found Perl's syntax to be cryptic and the learning of it slow going, at some point unfortunately I stopped trying to learn it. You might take to learning Python, which reads more like spoken language, with greater ease than Perl. Just as arizonagroovejet indicated the programming language that is right for you might be narrowed down by knowledge of your purpose in using it, but I don't think you've disclosed that. Will this be your first programming language?
I am only now just starting to learn Python myself but I feel as though this should have been my starting place with scripting alongside the Bash shell. There are many differences between the scripting languages beyond one's ability to grasp a particular language readily, such differences are noted in some threads I've read recently. I felt Su-Shee's comments in the thread Lisp, Ruby, or python were very insightful, also consider reading I want to script and Which scripting language to learn.
For Python resources consider a page of the Python Wiki.
Good luck with your hunting and I hope you enjoy the language you choose!
For my own two cents, I know little bash scripting (a deficiency I hope to correct soon), but have been hacking along with perl for some time. Both are powerful, and very configurable, and you'll find individuals on both sides of the argument, I've found it really does come down to personal preference. Perl's syntax makes sense to me (not that bash's doesn't), and I enjoy it's modular customizability.
Well, bash is the shell you login with, so it makes sense to know that language. You can also call awk/sed etc as mentioned.
However, it is interpreted and it can get pretty fiddly/messy if you want to do longer/more complex programs.
See the link in post #2
This is where Perl comes in. Its compiled-on-the-fly and its got the same capabilities as C, but easier to program, with about 80-90% the speed. You don't have to shell out to do stuff, so its a more 'integrated' lang.
Ideally you'd learn both, so you have the right tool for the job.
Start off with learning bash.
But be aware that if you plan on doing more complex scripting you may have to learn other languages to extend bash, eg awk, sed, etc.
Perl is rather cryptic, but it has a rich command set and accompanying library to extend it.
It is a full blown computer programming language (with all the bells and whistles) that is great for doing complex administration stuff!
Also Perl will be more portable between *nix flavours compared to bash which can differ!
Based on self experience:-
start with bash...when I learnt scripting some years back.I found bash more aesy going (though that depends from person to person)...Now I am comfortable with perl..but that time learning perl was hectic, atleast to me as compare to me.
Based on self experience:-
start with bash...when I learnt scripting some years back.I found bash more aesy going (though that depends from person to person)...Now I am comfortable with perl..but that time learning perl was hectic, atleast to me as compare to me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.