[Xquartz-dev] 2.3.2_rc4

Cameron Simpson cs at zip.com.au
Fri Dec 19 17:44:38 PST 2008


On 20Dec2008 01:37, Martin Costabel <costabel at wanadoo.fr> wrote:
> Peter O'Gorman wrote:
>> 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(*). [...]
> (*)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...

I have an explaination. His exec line needs my $qcmd string as well,
thus:

  #!/bin/bash
  qcmd=
  for arg
  do  qcmd=$qcmd`printf " %q" "$arg"`
  done
  exec -l "$SHELL" -c "exec $qcmd"

This skips login(1) and possibly addresses Harald's issue with = signs
in the zeroeth argument. It doesn't address the generic syntax issue
he raises.

I have an idea for that for my next post (have to do a machine shutdown
first:-)

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

"Vy can't ve chust climb?"  - John Salathe


More information about the Xquartz-dev mailing list