News for hackers. Stuff that matters.
Re:How to Debug Bash Scripts by ilyak on Tuesday August 25, 2009 @10:47AM (#784940)
Why do they always focus on bash (or mysql, or php, or whatever).

90% of the article is applicable for other shells, like zsh or fish.

Why not write "how to debug shell scripts"?

Re:How to Debug Bash Scripts by scott_s on Tuesday August 25, 2009 @11:48AM (#785066)
I almost exclusively use bash. Not because of a particular love of bash, but just because that's the default install on Linux (and even OSX). Consequently, I don't know what the real differences are between bash and other shells.

It's possible the author is like me: because he's not familiar with what the differences between the shells are, he can't say what does and does not apply to other shells.

Re:How to Debug Bash Scripts by blasdel on Tuesday August 25, 2009 @02:54PM (#785474)
The differences:

  * zsh has a ton of interactive chrome built-in, and a lot of it is on by default.
      This leads to some incompatibility with bash for scripting purposes
      the contextual completion stuff is infuriating when it's overly restrictive
  
  * A pure bourne shell (like dash) by nature doesn't support bashisms
      like $() as an alternative to ``
      On almost all gnu systems /bin/sh is a link to bash 
        which checks $0 and operates in sh mode
      Unfortunately bash's sh mode is completely broken
        it allows most bash-specific syntax
        so almost a lot of Linux users's #!/bin/sh scripts really need bash
The takeaway is that you should give up and use bash, or write your own shell if you're an asshole (I have done this).
Re:How to Debug Bash Scripts by jrschulz on Tuesday August 25, 2009 @04:42PM (#785766)
Command substitution using $(...) is valid POSIX syntax, not a bashism.

   $ /bin/dash
   $ echo $(uname -r)
   2.6.31-rc7
Re:How to Debug Bash Scripts by jrockway on Tuesday August 25, 2009 @06:58PM (#786094)
or write your own shell if you're an asshole

Eshell.

It is nice to write "shell scripts" like "(loop for i in *.el do (byte-compile-file i))".