4 ms·
Yup. There are more shells than there are IDEs, keyboard switch types, keyboard layouts, and operating systems. Shell ideological wars get just as bad as emacs/
by sudhirj 5y ago
Yup. There are more shells than there are IDEs, keyboard switch types, keyboard layouts, and operating systems. Shell ideological wars get just as bad as emacs/vim and linux/Mac. Use whatever you want, but company IP is shbang'd to bash.
- OJFord 5y ago> shbang'd to bash. Good. Better: #!/bin/sh Best: #!/bin/sh and also not assuming bash anyway!
- bobthebuilders 5y agoI wouldn't say putting a sh shebang and assuming bash is better. With a bash shebang at least you're honest about it.
- OJFord 5y agoWell yes, absolutely. I phrased that poorly, what I meant was like '/bin/sh is better... Especially if it actually works' or something. It's easily done though, I've often thought I've written something POSIX compatible and then had shellcheck say nope.
- sudhirj 5y agoIf we're distributing software, maybe? Personally we control the hardware, so we know what we're running, but yeah, for libraries or packages this makes sense.
- roywashere 5y agoOh and how /bin/bash is bash3 on macOS instead of the contemporary bash5 by default. And how sh is dash on Debian, or Ubuntu, I forgot. Some of the reasons why I would prefer python3 scripts (or perl) over sh or bash
- dundarious 5y agoPretty annoying to reliably #! to python3 as well. Is it /usr/bin/python or python3?
- OJFord 5y agoThat's my worst. I think generally python3 is safe (if unnecessary) today? But for how long do we have to keep that around? Can we now say Well python2 is EOL so python should certainly be v3+? It is of course a more general issue with shebangs that it's a very loose 'dynamically linked' coupling, not necessarily judt affecting language version but environment/libraries too, it just seems particularly problematic or prevalent with python.
- emptyparadise 5y ago/usr/bin/env python3
- vbrandl 5y agoBest would actually be #!/usr/bin/env sh Since this binary is required by the POSIX standard to exist at that location.