[Xquartz-dev] 2.3.2_rc4

Harald Hanche-Olsen hanche at math.ntnu.no
Tue Dec 23 14:55:01 PST 2008


+ Cameron Simpson <cs at zip.com.au>:

> On 23Dec2008 13:26, Harald Hanche-Olsen <hanche at math.ntnu.no> wrote:
> [...]
>> case "$SHELL" in
>>  */ksh | */sh | */zsh)
>>    exec -l "$SHELL" -c 'exec "$@"' - "$@" ;;

[...]

>> The obvious advantage of this [...]
>> [we] 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.

Indeed.

> I would like to combine your approach and mine: run the "known" shells
> your way - directly, and replace your:
> 
>   *)
>     exec "$@" ;;
> 
> with my approach.

Okay, but I'd still like to keep the ~/.x11run hack for those cases
where we really got things wrong, or when users want to do things
their own way.

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

Doesn't matter. That argument merely becomes the $0 of the shell being
exec'd, which we duly ignore. This is one of these little differences
between the bourne shells and other shells that make life exciting.

; sh -c 'echo $0 ... $1 $2 $3' a b c d e
a ... b c d
; csh -c 'echo $0 ... $1 $2 $3' a b c d e
/bin/csh ... a b c
; es -c 'echo $0 ... $1 $2 $3' a b c d e
/bin/es ... a b c
; rc -c 'echo $0 ... $1 $2 $3' a b c d e
/opt/local/bin/rc ... a b c

- Harald


More information about the Xquartz-dev mailing list