BUGFIX: Fixed foamExec, based on OpenFOAM 2.3.x. Essentially the 'exec' command would not get a valid argument list, because it would have been shifted somewhere inside 'etc/bashrc' and associated environment shell scripts.
BUGFIX: Bash allows for some additional IF blocks which are not available on regular sh-type shells, such as Dash, which is the default '/bin/sh' in Ubuntu. This commit fixes at least two situations which were mostly Bash oriented.