[Xquartz-dev] 2.3.2_rc4

Cameron Simpson cs at zip.com.au
Fri Dec 19 15:08:11 PST 2008


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.

To this end Martin wrote a small wrapper to use the login(1) command to
invoke the user's shell (which we, the caller, are trying not to know
about) in login mode to run the command.

I griped about the potential command line mangling, hence my updated
version as a suggested fix.

That it's written in bash (for "printf %q") is irrelevant to the target
problem of running the _user's_ shell to get the environment, as flexibly as
possible.

The quoting can be done in /bin/sh, but it's more cumbersome and much
harder to read. And slower.

Does that clarify things?
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

What's the best platform that Windows NT runs on?
A Kodak carosel slide projector.        - Dvorak


More information about the Xquartz-dev mailing list