4 ms·
/bin/sh is most often either the C shell, Dash, or Ash, not the Bourne shell. Bourne shell extensions will cause the script to fail. edit: bourne again shell
by peterwwillis 8y ago
/bin/sh is most often either the C shell, Dash, or Ash, not the Bourne shell. Bourne shell extensions will cause the script to fail.
edit: bourne again shell
- moviuro 8y agoYou certainly meant /bin/sh is not the Bourne again shell. I updated my comment to clear any possible misunderstanding https://en.wikipedia.org/wiki/Bourne_shell https://en.wikipedia.org/wiki/Bourne_shell https://en.wikipedia.org/wiki/Bourne-again_shell https://en.wikipedia.org/wiki/Bourne-again_shell
- floatboth 8y ago/bin/sh shouldn't be a C shell, it's always a POSIX-compatible shell IIRC
- peterwwillis 8y agoI suppose you're right, though the main point is it may not have Bourne-again extensions
- scruple 8y agoIn the wild, hopefully not, but I do remember coming across /bin/sh executing csh in an obscure RTOS-ish / proprietary flavor of Linux that we were prototyping at a previous employer. Would've been around 2008. I can't remember the variant, but I remember being caught off-guard by it.
- gkya 8y agoAFAIK /bin/sh is standard; if you cannot trust that /bin/sh is a Bourne-like sh, you might as well have to assume /usr/bin/env can not be what it was meant to be too.
- deleted 8y ago[deleted]
- cowmoo728 8y agoI once triggered an automatic deploy that ran a bash script that minified a bunch of css/html/js assets and pushed them to S3, at some path like `/assets/vX.X.X/whatever.css`. Unfortunately, a few of our deploy boxes had Dash instead of Bourne shell, and when it ran on dash it failed to parse the version tag to push and ended up pushing an empty dir to /assets - deleting everything. Fun experience.
- michaelcampbell 8y ago> /bin/sh is most often either the C shell, Never once have I ever seen this. In 25+ years.