Mailinglist Archive: opensuse-factory (689 mails)

< Previous Next >
Re: [opensuse-factory] Re: why are raw scripts forced into /bin/sh instead of user's shell (a Suse patch to bash)

Quoting Linda Walsh <suse@xxxxxxxxx>:


But the problem is what Ruediger Meier wrote -- if you don't
invoke the user's shell the way it is in their /etc/passwd (or in their SHELL --
usually the same), then you are changing the user's default shell with which
such scripts are executed.

[...]
*IF* I put in #!/bin/bash at the beginning, then the correct shell is used,
but by default, it should use the same shell as what the user is running under
when they type the name of the shell script.

It would be like developing a shell script, then when I put it in a file and
execute it (w/o any header line), someone chose to run a #/bin/python on my
script instead of the shell I was using.


Whereas I sort of understand your point (I hope), I also have to say that 'not specifying' the she-bang would leave you in a much worse situation, as a user NOT running bash (but maybe ash, zsh, csh), would execute your script and then fall flat on his nose... because the script requires bash to execute (due to bashism).

Would be as bad as writing python code and hoping that bash knows what to do with it when not specifying the interpreter.

Dominique
--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-factory+owner@xxxxxxxxxxxx

< Previous Next >
List Navigation
Follow Ups