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.
A Linux / perl expert told me i am wasting my time learning bash scripting at this stage and should go straight onto learning Perl...would you agree with this?
i started reading a book on shell scripting, but am thinking now if i should get a good perl book...
You will find some systems, like *BSD do not come standard with BASH (though it could be installed), and others, such as a minimal Red Hat load, doesn't install perl by default. I would say the best approach is learning both OR learning the one that is most prevalent in your particular environment. If your environment includes both, I would opt for the perl, as it is a high-level language... Once you have it down, you will be amazed at how easy you can pick-up shell scripting for smaller tasks along the way.
Since you asked what BASH was used for about half a year ago I'd like to ask some questions: do you need shell scripting skills? If you do, what tasks have you used it for? Have you made scripts that were used (preferably in a production environment)? Did you have scripts blow up in peoples faces reminding you that error handling is more important than pretty-printing output? What would replacing your scripts with a PERL script accomplish in terms of combating code rot, ease of maintenance or performance? Will you need PERL knowledge in the near future? If you have no clue about this all then you're ready to start learning PERL from scratch and without any idea what to do with the knowledge ;-p Me, I'd rather go solve a problem than read a book on PERL. When I encounter a problem then I'll stop and read. But of course everyone is free to choose their own approach...
Location: a warm beach, cool ocean breeze, nice waves, and a Margaritta
Distribution: RHEL 5.5 Tikanga
Posts: 63
Rep:
perl looked waaaay too scary to me!!!
i try to write in awk and bash and sed - only been writting for a year or two as i need to.
i know a serious tek head who knows a bunch of languages and he really suggests python, says it has way more power than perl and easier to learn, but idk.
It depends on what you want to accomplish. Learning bash is definitely not a waste of time. Perl is more powerful than bash in the sense that it can do more, but it can be slower and more convoluted, and it may not be what you need.
Hi guys thanks for all the input. I do not work in the unix industry. I work in a windows enviroment but have been focussing more on linux the last year or so. I am busy doing a few certs to further my knowledge and wondered about bash scripting vs perl in the real world...wouldnt want to involve myself with something that was becoming obsolete. Which is sort of what my friend was telling me about. Im looking to focus on the LAMP stack and want to become skilled with apache and databases etc etc...any skills you guys think are very neccesary let me know.
Neither bash nor perl will become obsolete anytime soon. If you aren't sure you will be using Linux in the future then perl would be the way to go. If you want to be a Linux sysadmin then bash would be the way to go.
Forgive me, but the only waste of time was when you talked with the "expert".
First of all, learning new things is never a waste of time.
Secondly, bash/shell scripting will be always useful and in my opinion is mandatory learn it.
In addiction shell scripting is not hard so, when you will have familiarity with it, you can learn perl too.
Have fun.
It depends on what you want to accomplish. Learning bash is definitely not a waste of time. Perl is more powerful than bash in the sense that it can do more, but it can be slower and more convoluted, and it may not be what you need.
Actually, it is faster.
The time to use perl is when you want something safe. It is easier to get quoting correct, and getting the script secured is just as easy (just turn on the "taint" flag, and fix the errors reported).
For large scripts, perl is better. For small simple scripts bash is sometimes easier.
Neither bash nor perl will become obsolete anytime soon. If you aren't sure you will be using Linux in the future then perl would be the way to go. If you want to be a Linux sysadmin then bash would be the way to go.
Both would be the way to go.
bash lets you interpret most things the system does (except when it gets to systemd based systems).
Perl lets you do very complex things that bash just fails at.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.