Timeline for Is there any reason to have a shebang pointing at /bin/sh rather than /bin/bash?
Current License: CC BY-SA 3.0
26 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 5, 2016 at 19:11 | review | Close votes | |||
| Jan 5, 2016 at 22:08 | |||||
| Dec 31, 2015 at 19:02 | history | tweeted | twitter.com/StackUnix/status/682637907375591424 | ||
| Dec 31, 2015 at 13:56 | history | reopened | Ulrich Schwarz jasonwryan Michael Homer G-Man Says 'Reinstate Monica' Jules | ||
| Dec 31, 2015 at 8:42 | comment | added | Wildcard | I think there are many excellent objective answers which have been given...but I wouldn't mind seeing this question "protected." | |
| Dec 30, 2015 at 6:40 | review | Reopen votes | |||
| Dec 30, 2015 at 8:54 | |||||
| Dec 30, 2015 at 6:38 | history | closed | muru cuonglm slm♦ | Opinion-based | |
| Dec 30, 2015 at 3:04 | review | Close votes | |||
| Dec 30, 2015 at 6:38 | |||||
| Dec 24, 2015 at 7:23 | comment | added | Thorbjørn Ravn Andersen | "pretty much" is not the same as "always". /bin/sh is always there. Guaranteed. | |
| Dec 23, 2015 at 13:46 | comment | added | schily | #!/bin/sh should not be used if a script contains bashisms but it is also good practice to try to write scripts in a way that would allow execution with the SVr4 Bourne Shell. Compatibility with the SVr4 Bourne Shell can be checked using the osh binary from the Schily Bourne Shell schilytools.sourceforge.net/bosh.html | |
| Dec 23, 2015 at 7:35 | comment | added | mikeserv | @JdeBP - i don't think so. the only way you could is to first assume the opinion of the asker - which means to take as a given that there might be some reason to do #!/bin/bash. | |
| Dec 23, 2015 at 5:36 | comment | added | Jules | @user2338816 my bad, I meant objective. Thanks for your points! | |
| Dec 23, 2015 at 5:18 | comment | added | user2338816 | @JulesMazur ...the answers so far are fairly subjective... A "subjective" statement is essentially opinion-based by definition. /bin/bash should only be used when bash is explicitly needed. In 40+ years as a developer, long before bash, I almost never explicitly needed it except when testing. (I also strive to avoid shell extensions, but most of my scripts are intended for distribution.) Many scripts on the net should also be intended for wide use. | |
| Dec 23, 2015 at 1:05 | answer | added | Paul Evans | timeline score: 0 | |
| Dec 22, 2015 at 19:21 | comment | added | sixtyfootersdude | @purplepsycho - This is only true if you test and verify that your script doesn't use specific bash functions. See my answer for more info. | |
| Dec 22, 2015 at 19:20 | answer | added | sixtyfootersdude | timeline score: 8 | |
| Dec 22, 2015 at 18:24 | comment | added | JdeBP | I believe that it is possible to answer this question without involving mere opinion, by pointing to at least two organizations that addressed this very thing over a number of years, and looking at the history and outcome. With plenty of further reading attached, to boot. ☺ | |
| Dec 22, 2015 at 18:14 | answer | added | JdeBP | timeline score: 20 | |
| Dec 22, 2015 at 17:14 | comment | added | Jules | @mikeserv I intended for this question to be more about best practices than opinion - and the answers so far are fairly subjective, at least IMO (no meta-humour intended!). I'm open to hearing more about whether or not, and why, this would qualify as opinion, though. | |
| Dec 22, 2015 at 16:47 | review | Close votes | |||
| Dec 22, 2015 at 20:14 | |||||
| Dec 22, 2015 at 16:31 | comment | added | mikeserv | in general you should avoid asking questions which lend themselves to answers based on opinion (which is the only possible way i believe this question can be answered - but that's just my opinion). | |
| Dec 22, 2015 at 15:59 | vote | accept | Jules | ||
| Dec 22, 2015 at 15:53 | answer | added | zwol | timeline score: 5 | |
| Dec 22, 2015 at 15:19 | answer | added | user79743 | timeline score: 26 | |
| Dec 22, 2015 at 14:02 | answer | added | Marco | timeline score: 84 | |
| Dec 22, 2015 at 13:52 | comment | added | Mathieu | It's a good partice to use /bin/sh if you do not use specific bash functions. One day you could have to use one of your script on a system on which it is not installed (remote server, embedded computer...) | |
| Dec 22, 2015 at 13:45 | history | asked | Jules | CC BY-SA 3.0 |