[Xquartz-dev] 2.3.2_rc4

Cameron Simpson cs at zip.com.au
Tue Dec 23 16:00:18 PST 2008


On 23Dec2008 23:55, Harald Hanche-Olsen <hanche at math.ntnu.no> wrote:
| + Cameron Simpson <cs at zip.com.au>:
| > 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.

Absolutely.

I'd go for your script, exact as is, with the above:

  *)
    exec "$@" ;;

replaced with:

  *)
    exec with-login-env "$@" ;;

and install with-login-env separately, since it's a generic thing.
I could argue either way for whether the case statement might live
here or in with-login-env.

| > 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

Ouch! I hadn't realised this. But then I've never tried to combine -c
with command line arguments and have quietly assumed they were
incompatible. Interesting.

| ; 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

Yeah, this is what I was expecting for the Bourne shells too. I will
adjust my illusions.

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


More information about the Xquartz-dev mailing list