ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
Other than 'man bash', can anyone recommend a good bash tutorial (doc, web site, or forums)? Preferably on-line stuff. I'll try to pick up a book at some point.
I understand one can create an interactive script, but the example I saw uses animals. As if one would actually write a script to get an animal from the user! Give me a real-world example of problems scripts like this solve.
Basically, all the syntax you need to be productive with shell scripts is pretty simple - everything you'd need to use for 90% of your scripting needs could easily boil down to a page or less.
The issue really isn't so much about "how to write shell scripts" as "how to use the power of shell scripts to solve real problems."
Furthermore, learning the shell really involves also familiarizing yourself with the Unix/Linux toolset - "awk", "sed", "tr", "sort", "cut", "uniq" and so forth.
Here are two book suggestions that would help you not only with "shell scripting", but with the bigger picture of "effectively using the *nix environment":
1) The Unix Programming Environment, Kernighan & Pike
A venerable classic from the early 80's ... and still, I believe, directly
applicable to your question
2) Linux Server Hacks, Rob Flickener
A treasure chest of great ideas and ready-made solutions
This is helpful. Naturally, after I asked the question, then I found some useful links in the "Links" section of this site. Oops. Perhaps if some the Guides and tutorials used more of a problem-solving approach, it would be easier to see other instances how/where I might use a certain script.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.