[Xquartz-dev] 2.3.2_rc4
Martin Costabel
costabel at wanadoo.fr
Fri Dec 19 16:37:11 PST 2008
Peter O'Gorman wrote:
> Cameron Simpson wrote:
>> On 20Dec2008 10:08, I wrote:
>> | On 19Dec2008 16:43, Peter O'Gorman <peter at pogma.com> wrote:
>> | | Cameron Simpson wrote:
>> | | > On 20Dec2008 08:57, I wrote:
>> | | > | What's wrong with this?
>> | | > | #!/bin/bash
>> | |
>> | | If you're going to use bash, why not just exec -l the users shell to
>> | | make it start with argv[0] = '-'?
>> | |
>> | | Not that I'm quite following what you're trying to do though.
>> |
>> | The objective is to invoke the user's (entirely arbitrary) login shell
>> | to get their login env, and then to the X11 session so it runs with that
>> | environment.
>>
>>
>> My reply missed the point of your query, sorry. Not all shells take a -l
>> option AFAIK. Hence the hopping through login(1).
>
> My question was, why not:
>
> #! /bin/bash
> exec -l "$SHELL" "$@"
>
> See 'help exec' in bash.
Both these solutions work with tcsh as login shell. Nice(*).
They don't, however, work with bash as login shell. Neither after
/usr/bin/login nor after exec -l are the bash login startup scripts
read. I have no explanation, I am simply observing it.
Thus these solutions might work with Jeremy's ~/.x11run indirection, but
not directly in an X11 wrapper script.
(*)What I am also observing is that both my primitive .x11run script and
Cameron's deluxe version are actually working, whereas Peter's elegant
"exec -l" solution works in a script called from the command line, but
does not work inside .x11run. There it leads to error messages of the type
> Dec 20 01:11:47 mbookp [0x0-0x62062].org.x.X11[1524]: Warning: no access to tty (Bad file descriptor).
> Dec 20 01:11:47 mbookp [0x0-0x62062].org.x.X11[1524]: Thus no job control in this shell.
> Dec 20 01:11:47 mbookp [0x0-0x62062].org.x.X11[1524]: \312\376\272\276^B^G^C^P^Z\2120^L^R: Command not found.
> Dec 20 01:11:47 mbookp [0x0-0x62062].org.x.X11[1524]: Illegal variable name.
> Dec 20 01:11:47 mbookp com.apple.launchd[127] ([0x0-0x62062].org.x.X11[1524]): Exited with exit code: 1
No explanation; just observing...
--
Martin
More information about the Xquartz-dev
mailing list