32

I've programmed in a number of languages for two years now, I mean that I know how to design and implement a decent solution for a given problem.

However, bash is being a major headache to me, just nothing does work as expected—or even without errors.

All of the guides I've found were incredibly informal, not properly summarising its syntax or telling the most common errors you can make.

So what can you recommend me?

jasonwryan
  • 71,734
  • 34
  • 193
  • 226
deprecated
  • 2,841
  • 4
  • 24
  • 22

5 Answers5

22

I like the TLDP guides http://tldp.org/guides.html

There is everything from Beginners to Advanced Bash guides; it's how I learned anyways.

jasonwryan
  • 71,734
  • 34
  • 193
  • 226
  • Thank you, looks like you can find other useful guides in general there, as well. – deprecated Apr 28 '11 at 18:53
  • 1
    I read from someone who works on an automatic code checking tool for bash scripts: "TLDP is, shall I say politely, not recommended for guidance on writing shell scripts." – phk Oct 15 '15 at 16:43
  • 1
    @phk Well, it does contain lots of stuffs that are too step-by-step, like `blah; exitval=$?; if [ "$exitval" -ne 0 ]`… Luckily people learn fast after you point those out. – Mingye Wang Oct 15 '15 at 19:18
13
All of the guides I've found were incredibly informal, not properly summarising its syntax or telling the most common errors you can make.

The best resource, and one that does address common errors, is Greg's Wiki

Another very good resource for pointers on syntax and good practice is the Bash Hackers Wiki

jasonwryan
  • 71,734
  • 34
  • 193
  • 226
0

If you want a bit more detail on what's actually going on and common mistakes you can fall into then this Bash Scripting Tutorial may be a good read.

Ryan
  • 11
  • 1
0

Might be a bit late, but I find this site very benficial

www.linuxcommand.org

prometheuspk
  • 101
  • 2
0

I learn a lot from the book UNIX Power Tools. Although is is not a book exclusively on shell programming, I found the topics are easy to understand and there are plenty of tricks to learn.

Hai Vu
  • 1,181
  • 6
  • 8