[Xquartz-dev] 2.3.2_rc4

Cameron Simpson cs at zip.com.au
Tue Dec 23 14:18:31 PST 2008


On 23Dec2008 13:26, Harald Hanche-Olsen <hanche at math.ntnu.no> wrote:
[...]
> case "$SHELL" in
>  */ksh | */sh | */zsh)
>    exec -l "$SHELL" -c 'exec "$@"' - "$@" ;;
>  */csh | */tcsh)
>    exec -l "$SHELL" -c 'exec $argv:q' "$@" ;;
>  */es | */rc)
>    exec "$SHELL" -l -c 'exec $*' "$@" ;;
>  *)
>    exec "$@" ;;
> esac
>
> The obvious advantage of this being, in case it needs spelling out, that 
> we are not trying so hard to quote stuff for the benefit of oddball 
> shells, but pass in the raw arguments for each shell itself to handle 
> properly according to its own ways.

Yes, I like this aspect. The downside is that we need to know about every
shell that will ever occur, and further trust that the shell basename is
enough to recognise them.

I would like to combine your approach and mine: run the "known" shells
your way - directly, and replace your:

  *)
    exec "$@" ;;

with my approach.

That should get us coverage for shells we have not anticipated.

BTW, shouldn't your Bourne shell like use "--" instead of "-"?

Cheers,
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

This bottle of whisky is awful.  I'll be glad when it's done.
        - One Scot to another


More information about the Xquartz-dev mailing list