tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Proposed update to bmake-20240711



Learn something new every-day...

On Fri, 12 Jul 2024 12:11:59 -0700, "Greg A. Woods" writes:
>At Fri, 12 Jul 2024 08:29:04 -0700, Simon Gerraty <sjg%crufty.net@localhost> wrote:
>Subject: Re: Proposed update to bmake-20240711
>>
>> I build every bmake release on Darwin and all tests pass.
>> It is just using /bin/sh which does not appear to be an alias for any of
>> the others:
>>
>> : sjg; ls -l /bin/*sh
>> -r-xr-xr-x  1 root  wheel  1326752 May  2 14:33 /bin/bash
>> -rwxr-xr-x  2 root  wheel  1153408 May  2 14:33 /bin/csh
>> -rwxr-xr-x  1 root  wheel   307248 May  2 14:33 /bin/dash
>> -r-xr-xr-x  1 root  wheel  2598896 May  2 14:33 /bin/ksh
>> -rwxr-xr-x  1 root  wheel   134000 May  2 14:33 /bin/sh
>> -rwxr-xr-x  2 root  wheel  1153408 May  2 14:33 /bin/tcsh
>> -rwxr-xr-x  1 root  wheel  1377520 May  2 14:33 /bin/zsh
>
>/bin/sh on macos isn't an alias, it's a wrapper, as revealed by strings,
>and as is documented in sh(1):

>
>$ ll /bin/*sh
>1368 -r-xr-xr-x  1 root  wheel  restricted,compressed 1310352 May  7 00:01 /bi
>n/bash
>1048 -rwxr-xr-x  2 root  wheel  restricted,compressed 1136896 May  7 00:01 /bi
>n/csh
> 224 -rwxr-xr-x  1 root  wheel  restricted,compressed  274480 May  7 00:01 /bi
>n/dash
>2744 -r-xr-xr-x  1 root  wheel  restricted,compressed 2582512 May  7 00:01 /bi
>n/ksh
>  24 -rwxr-xr-x  1 root  wheel  restricted,compressed  101232 May  7 00:01 /bi
>n/sh
>1048 -rwxr-xr-x  2 root  wheel  restricted,compressed 1136896 May  7 00:01 /bi
>n/tcsh
>1472 -rwxr-xr-x  1 root  wheel  restricted,compressed 1361200 May  7 00:01 /bi
>n/zsh
>
>$ strings /bin/sh
>@(#)PROGRAM:sh  PROJECT:dash-12
>/bin/bash
>/bin/dash
>/bin/zsh
>/private/var/select/sh
>Error opening %s: %s
>Unrecognized shell referenced in %s: %s
>Failed to exec %s as variant for /bin/sh (%d: %s).
> Falling back to %s.
>Failed to exec %s as variant for /bin/sh (%d: %s).
>
>As you can guess from the strings output it is controlled by a symlink
>in /var/select:
>
>$ ll /private/var/select/sh
>0 lrwxr-xr-x  1 root  wheel  - 9 May  7 00:01 /private/var/select/sh -> /bin/b
>ash

Thanks - same on my box.

>As an aside I have a series of functions at the top of my ~/.shrc which
>can, within some limits(*), test which kind of shell
>is running them, at least within the range of shells I typically might
>try to use as my login shell on any given type of system (which notably
>has never included Zsh):
>
>	https://github.com/robohack/dotfiles/blob/master/.shrc
>
>(*) they're mostly designed to control which features of my ~/.profile
>et al are enabled.
>
>Note the is_ksh function is the most lax and generally just means
>"ksh-like".  It doesn't think zsh is suitable, on purpose.  Indeed all
>but one of the other functions don't like the current zsh (in default
>modes) on macos either, though is_ash is "fooled" by it (though is_ash
>is the least well tested).
>
>
>On macos I use /bin/ksh as my login shell, but as you can see above I
>keep /bin/sh pointed at /bin/bash as that's been the most reliable
>combination for me.
>
>--
>					Greg A. Woods <gwoods%acm.org@localhost>
>
>Kelowna, BC     +1 250 762-7675           RoboHack <woods%robohack.ca@localhost>
>Planix, Inc. <woods%planix.com@localhost>     Avoncote Farms <woods%avoncote.ca@localhost>
>
>--pgp-sign-Multipart_Fri_Jul_12_12:11:50_2024-1
>Content-Type: application/pgp-signature
>Content-Transfer-Encoding: 7bit
>Content-Description: OpenPGP Digital Signature
>
>-----BEGIN PGP SIGNATURE-----
>
>iF0EABECAB0WIQRuK6dmwVAucmRxuh9mfXG3eL/0fwUCZpF/+QAKCRBmfXG3eL/0
>fxjhAKCLHgpsLcIKFwHScdvZZFopgYItFACgjVq1MewOli+5TVpDOmpsGXgOi7I=
>=LVAm
>-----END PGP SIGNATURE-----
>
>--pgp-sign-Multipart_Fri_Jul_12_12:11:50_2024-1--


Home | Main Index | Thread Index | Old Index