3 ms·
I settled with using /bin/sh for portability. If there is something that can't be done with sh but can be done with bash then it means a python script is better
by johnchristopher 5y ago
I settled with using /bin/sh for portability. If there is something that can't be done with sh but can be done with bash then it means a python script is better anyway. I don't want to deal with bashism and ksh and deb/ub/rh different takes on bash.
It's frustrating that most google search results and shell script search results on SO almost always mean bash and sh.
- jenscow 5y agoYes, well if a script I wrote has somehow ended up on a machine without bash, then I'd be more worried about other assumptions the script makes.
- johnchristopher 5y agoThat's missing the point. Some server I know don't have vim. Traefik docker image is running ash and not bash. Tomcat image hasn't vim. Etc. /bin/sh is there. No worry about assumptions. No bashism, no fish, no zsh.
- jenscow 5y agoThat's fine. My scripts tend to run on a single machine.. otherwise, probably the same/similar Linux distro. So for me, if there's not even bash then I've also surely not accounted for other peculiarities on the system.