[Xquartz-dev] 2.3.2_rc4

Jeremy Huddleston jeremyhu at apple.com
Fri Dec 26 09:25:09 PST 2008


Is there a reason we don't do 'exec -l' for bash?

On Dec 26, 2008, at 05:24, Harald Hanche-Olsen wrote:

> Uh, sorry, there was one more thing ... if a former bash user has
> converted to another shell, and still has his bash login stuff lying
> around, it will be run in addition to the other shell's login files. I
> think that is wrong. Therefore I believe this version is better:
>
> #!/bin/sh
>
> set "$(dirname "$0")"/X11.bin "${@}"
>
> if [ -x ~/.x11run ]; then
> 	exec ~/.x11run "${@}"
> fi
>
> case $(basename "${SHELL}") in
> 	bash)         exec    "${SHELL}" --login -c 'exec "${@}"' - "${@}" ;;
> 	ksh|sh|zsh)   exec -l "${SHELL}" -c 'exec "${@}"' - "${@}" ;;
> 	csh|tcsh)     exec -l "${SHELL}" -c 'exec $argv:q' "${@}" ;;
> 	es|rc)        exec -l "${SHELL}" -c 'exec $*' "${@}" ;;
> 	*)            exec    "${@}" ;;
> esac
>
> (I also added the ;; to the final clause, since the bash docs show it
> to be required, even though in practice it is not.)
>
> - Harald
> _______________________________________________
> 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