Go to the first, previous, next, last section, table of contents.
There are several families of shells, most prominently the Bourne family and the C shell family which are deeply incompatible. If you want to write portable shell scripts, avoid members of the C shell family.
Below we describe some of the members of the Bourne shell family.
foo= false $foo echo "Don't use it: $?"
cat ${FOO=`bar`}
BASH_VERSION
is set. To disable its extensions and require
POSIX compatibility, run `set -o posix'. See section `Bash POSIX Mode' in The GNU Bash Reference Manual, for
details.
ZSH_VERSION
is set. By default @command{zsh} is not
compatible with the Bourne shell: you have to run `emulate sh' and
set NULLCMD
to `:'. See section `Compatibility' in The Z Shell Manual, for details.
Zsh 3.0.8 is the native @command{/bin/sh} on Mac OS X 10.0.3.
The following discussion between Russ Allbery and Robert Lipe is worth reading:
Russ Allbery:
The GNU assumption that @command{/bin/sh} is the one and only shell leads to a permanent deadlock. Vendors don't want to break user's existant shell scripts, and there are some corner cases in the Bourne shell that are not completely compatible with a POSIX shell. Thus, vendors who have taken this route will never (OK..."never say never") replace the Bourne shell (as @command{/bin/sh}) with a POSIX shell.
Robert Lipe:
This is exactly the problem. While most (at least most System V's) do have a bourne shell that accepts shell functions most vendor @command{/bin/sh} programs are not the POSIX shell.
So while most modern systems do have a shell _somewhere_ that meets the POSIX standard, the challenge is to find it.
Go to the first, previous, next, last section, table of contents.