I have learned Java, C++, python. But recently I need to write some bash script.

Is there any book for learning bash script? Not bash command.

  • FYI, There's no difference between Unix shell commands and shell scripting. The simplest shell scripts start as pasting a set of commands into a text file, just like you'd enter them at the shell prompt. Sure, you're not as likely to use if/thens and loops at the shell prompt, but they work the same way at the prompt as they do from a script file. Also, note that using syntax specific to one shell (such as bash) is considered poor form for shell scripts. It's better to write in the more universal POSIX Bourne shell (/bin/sh) syntax so that it can execute correctly in any shell. – Spiff Apr 2 '11 at 2:19

The Linux Documentation Project has a VERY nice BASH guide online. They call it the "Advanced Bash-Scripting Guide," but I think it is appropriate for beginners. This is my recommendation. http://tldp.org/LDP/abs/html/


From #bash /topic on irc.freenode.net:



Here is an answer from SO which I think it will help you to choose between the BashGuide by Lhunath. and Advanced Bash Scripting by Mendel Cooper on The Linux Documentation Project website.

In general, BashGuide is preferred for the beginner and it's very short - only 90 pages!

After that, you can also find a lots of useful information on Bash Pitfalls and Bash FAQ.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.