All further criticism aside:
/bin/sh is assumed to be Bash in your case.
However, /bin/sh can be about anything (dash, bash, one of the ksh's,...) on many systems,
making this very unreliable. And this doesn't even
include the fact that /bin/sh can be dynamically linked
to many different libraries which then differ on many systems.
All further criticism aside:
/bin/sh is assumed to be Bash in your case.
However, /bin/sh can be about anything (dash, bash, one of the ksh's,...) on many systems,
making this very unreliable. And this doesn't even
include the fact that /bin/sh can be dynamically linked
to many different libraries which then differ on many systems.
To avoid the need for specifying the kind of /bin/sh you meant, you could just make this script POSIX compatible without the BASH specific additions. This wouldn't make the system produce reliable (or even anything remotely reproducible) results as you still have the dynamic linking situation I described in a very short way, but it's a start.
To avoid the need for specifying the kind of /bin/sh you meant, you could just make this script POSIX compatible without the BASH specific additions. This wouldn't make the system produce reliable (or even anything remotely reproducible) results as you still have the dynamic linking situation I described in a very short way, but it's a start.
I don't follow your comments. I have tested my script with Debian dash and OpenBSD /bin/sh. To my knowledge only the use of local is an extension to POSIX.
Also, can you elaborate on this dynamic linking situation?
I don't follow your comments. I have tested my script with Debian `dash` and OpenBSD `/bin/sh`. To my knowledge only the use of `local` is an extension to POSIX.
Also, can you elaborate on this dynamic linking situation?
All further criticism aside: /bin/sh is assumed to be Bash in your case. However, /bin/sh can be about anything (dash, bash, one of the ksh's,...) on many systems, making this very unreliable. And this doesn't even include the fact that /bin/sh can be dynamically linked to many different libraries which then differ on many systems.
To avoid the need for specifying the kind of /bin/sh you meant, you could just make this script POSIX compatible without the BASH specific additions. This wouldn't make the system produce reliable (or even anything remotely reproducible) results as you still have the dynamic linking situation I described in a very short way, but it's a start.
I don't follow your comments. I have tested my script with Debian
dash
and OpenBSD/bin/sh
. To my knowledge only the use oflocal
is an extension to POSIX.Also, can you elaborate on this dynamic linking situation?