Bug#604010: x11-common: xsession should use $SHELL and not sh directly
On 2011-02-12 12:58:46 +0100, Cyril Brulebois wrote:
> Hi Michel,
>
> Michel Briand <michelbriand@free.fr> (19/11/2010):
> > 50x11-common_determine-startup SHOULD not use "sh $STARTUPFILE"
> > but "$SHELL $STARTUPFILE"
>
> I've just replaced that with:
> + shell=${SHELL:-sh}
> + STARTUP="$shell $STARTUPFILE"
>
> which should do what you want.
I think this change should be reverted, as this may break existing
scripts. The .xsession file has always been described as a Bourne
shell (sh(1)) script (see Xsession(5) man page), and if the user
has a $SHELL not compatible with sh(1), typically zsh, the script
may no longer run correctly.
Moreover I think this is a misuse of the SHELL environment variable,
which is there to run simple commands (for which the shell can only
be provided by external information), not full scripts.
> Anyway, why don't you make your script executable? This way, it's used
> directly, without going through sh/SHELL, and you get to decide,
> through your shebang.
BTW, this should be documented.
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)
Reply to: