Shebang Lines

Stephan Witt st.witt at gmx.net
Sun Jan 8 18:04:39 UTC 2023


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


More information about the lyx-devel mailing list