2012-11-01 Uwe Koloska:
There is stability in that /bin/sh always must be a (posix compatible) bourne (not again) style shell!
True
* rewrite the scripts to be truly posix and use #! /bin/sh (the dash links from another mail may help) * leave the scripts alone with all their bashisms and declare them with #! /bin/bash
My advice on this is: in all shellscripts you write, declare the shell that you are testing the script with -- so on most linux systems (and in windows unix environments like msys) use /bin/bash and only change this to /bin/sh if you have to.
I do it the other way. Always write /bin/sh compatible scripts (actually first-setup.sh uses /bin/sh) and resort to /bin/bash if bash specific features save considerable effort.
For example to make it compatible to a minimal system (a jeos VM comes to mind) that is not supposed to provide /bin/bash.
FreeBSD comes without bash installed by default. The point is that it's easy for shell scripts like first-setup.sh that can easily declare the shell in the she-bang line. But setuptex cannot start a new well-defined shell since it's supposed to modify the current environment. That's why setuptex is sourced instead of executed. That however implies that setuptex has to conform to the current shell, which is unknown and needs to be guessed without relying on anything the shell might not provide. Marco