[Xquartz-dev] 2.3.2_rc4
Jeremy Huddleston
jeremyhu at apple.com
Thu Dec 25 23:30:51 PST 2008
So this thread has pretty much settled down, and I'm still not 100%
sure where the chips landed. Looking through the thread, I think this
script will take care of bash, ksh, zsh, tcsh, es, and rc... Did I
miss a criticism of this approach (most replies seemed to be questions/
comments rather than problems).
--Jeremy
#!/bin/bash --login
set "$(dirname "$0")"/X11.bin "${@}"
if [ -x ~/.x11run ]; then
exec ~/.x11run "${@}"
fi
case $(basename ${SHELL}) in
ksh|sh|zsh) exec -l "${SHELL}" -c 'exec "${@}"' - "${@}" ;;
csh|tcsh) exec -l "${SHELL}" -c 'exec $argv:q' "${@}" ;;
es|rc) exec "${SHELL}" -l -c 'exec $*' "${@}" ;;
*) exec "${@}"
esac
On Dec 24, 2008, at 02:28, Martin Costabel wrote:
> Harald Hanche-Olsen wrote:
>> + Martin Costabel <costabel at wanadoo.fr>:
>>> Harald Hanche-Olsen wrote:
>>> []
>>>> To make life even more interesting, csh doesn't recognize the -l
>>>> flag if it also given the -c flag.
>>>
>>> This is not what I am observing. I see csh behaving exactly like
>>> tcsh in this respect.
>> Here be evidence (yes, the two shells behave the same):
>> ; csh -l -c 'echo Howdy.'
>> Unknown option: `-l'
>
> I see there was some misunderstanding. I thought you were talking
> about behavior with respect to "exec -l".
>
> The -l flag used directly on csh or tcsh has indeed to be the only
> flag, and it makes (or tries to make) an interactive shell, so it is
> not usable in the present context. OTOH, for bash, it (or its
> equivalent --login) *must* be used to get a login environment.
>
> []
>> It works because it does, in fact, use different methods to make a
>> non-interactive login process in the bash and (t)csh cases.
>
> Yes, this seems to be inevitable.
>
> --
> Martin
>
>
>
>
>
> _______________________________________________
> Xquartz-dev mailing list
> Xquartz-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/xquartz-dev
More information about the Xquartz-dev
mailing list