Shebang Lines

Stephan Witt st.witt at gmx.net
Sun Jan 8 20:26:22 UTC 2023


Am 08.01.2023 um 20:34 schrieb Dr Eberhard W Lisse <el at lisse.na>:
> 
> I didn't mean it just for that script.
> 
> I like the bash that is first in my path.

That’s what I don’t like.

The script works as expected with Apples /bin/bash and there is no need to fix something what’s not broken.

> I like the env method for all scripts (perl, bash, python lua and
> whatnot).

I can see the point for python. Not for bash.

> And, since Apple apparently prefers zsh to bash as the default
> shell nowadays it may just be that they will remove it like the
> did with python some time in the future.

I don’t think it will happen. This will break many scripts. Not just LyX. 

Stephan

> 
> On 08/01/2023 20:04, Stephan Witt wrote:
>> Am 07.01.2023 um 19:11 schrieb Richard Kimberly Heck <rikiheck at gmail.com>:
>>> 
>>> On 1/7/23 10:00, Dr Eberhard W Lisse wrote:
>>>> I see the
>>>> 
>>>> 	/Applications/LyX.app/Contents/MacOS/inkscape
>>>> 
>>>> script has
>>>> 
>>>> 	#!/bin/bash
>>>> 
>>>> as the shebang.  Can that please be changed (in all shell
>>>> scripts) to read
>>>> 
>>>> 	#!/usr/bin/env bash
>>> 
>>> Stefan, is this harmless?
>>> 
>>> Anyone else have thoughts about this?
>> 
>> I think this is not needed.  I wouldn’t change it.
>> 
>> The only reason to use the #!/usr/bin/env xxx thing is
>> portability.  But this script is not intended to be portable.
>> It’s for macOS.
>> 
>> There are possible drawbacks to use the #!/usr/bin/env xxx
>> thing.  The least one is the indirection José already mentioned.
>> The next one is the inability to say which bash will be
>> executed.  If $HOME/bin is in PATH and the is some executable
>> named bash it is started by the env utility.  Do you like that?
>> 
>> See also discussions here:
>> https://unix.stackexchange.com/questions/29608/why-is-it-better-to-use-usr-bin-env-name-instead-of-path-to-name-as-my
>> 
>> Eberhard, why do you see any real benefit here?
>> 
>> BR,
>> Stephan
> 
> -- 
> Dr. Eberhard W. Lisse   \         /       Obstetrician & Gynaecologist
> el at lisse.NA             / *      |  Telephone: +264 81 124 6733 (cell)
> PO Box 8421 Bachbrecht  \      /  If this email is signed with GPG/PGP
> 10007, Namibia           ;____/ Sect 20 of Act No. 4 of 2019 may apply
> -- 
> lyx-devel mailing list
> lyx-devel at lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-devel



More information about the lyx-devel mailing list