#1 /bin/sh is a problem

Closed
opened 6 years ago by ng0 · 2 comments
ng0 commented 6 years ago

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.
ng0 commented 6 years ago
Poster

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.
akkartik commented 6 years ago
Owner

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?
Sign in to join this conversation.
No Label
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.