On Thu, Mar 07, 2024 at 11:13:50PM +0100, Predrag Ze?evi? wrote:> Not all systems have /bin/sh linked to /bin/bash.Are there systems without /bin/sh? The objective isn't to use 'bash' implementation specifically, I believe? It was pointed out that check_socks() executes in whatever the remote side has as shell, so my shebang suggestion has no merit. Kind regards, Job
On Fri, 8 Mar 2024 at 09:19, Job Snijders <job at openbsd.org> wrote:> On Thu, Mar 07, 2024 at 11:13:50PM +0100, Predrag Ze?evi? wrote: > > Not all systems have /bin/sh linked to /bin/bash. > > Are there systems without /bin/sh?In practice probably not many, although it's not *required*[0] by POSIX. That said, there is also another (particularly older) subset of systems which have a /bin/sh that is sufficiently limited that writing anything nontrivial in them is difficult and painful, hence why the tests are run via whatever ends up in $TEST_SHELL instead of /bin/sh. [0] https://pubs.opengroup.org/onlinepubs/009695399/utilities/sh.html """ Applications should note that the standard PATH to the shell cannot be assumed to be either /bin/sh or /usr/bin/sh, and should be determined by interrogation of the PATH returned by getconf PATH , ensuring that the returned pathname is an absolute pathname and not a shell built-in. """ -- Darren Tucker (dtucker at dtucker.net) GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860 37F4 9357 ECEF 11EA A6FA Good judgement comes with experience. Unfortunately, the experience usually comes from bad judgement.
Hi, /bin/sh can be very different.... Ubuntu 22.04: :; ls -hal /bin/sh /bin/bash -rwxr-xr-x 1 root root 1,4M Jan 6 2022 /bin/bash lrwxrwxrwx 1 root root 4 Mar 23 2022 /bin/sh -> dash OpenIndiana (old OpenSolaris reincarnation) :; ls -hal /bin/sh /bin/bash -r-xr-xr-x 1 root bin 1,4M Jan 25 09:42 /bin/bash lrwxrwxrwx 1 root root 9 Apr 6 2021 /bin/sh -> i86/ksh93 On 2024-03-07 23:19, Job Snijders wrote:> On Thu, Mar 07, 2024 at 11:13:50PM +0100, Predrag Ze?evi? wrote: >> Not all systems have /bin/sh linked to /bin/bash. > > Are there systems without /bin/sh? The objective isn't to use 'bash' > implementation specifically, I believe? > > It was pointed out that check_socks() executes in whatever the remote > side has as shell, so my shebang suggestion has no merit. > > Kind regards, > > Job-- Predrag Ze?evi?