[Xquartz-dev] 2.3.2_rc4

Cameron Simpson cs at zip.com.au
Fri Dec 19 14:13:48 PST 2008


On 20Dec2008 08:57, I wrote:
| What's wrong with this?
| 
|   #!/bin/bash
|   : ${USER:=`id -un`}
|   : ${SHELL:=/bin/sh}
|   qcmd=
|   for arg
|   do  qcmd=$qcmd`printf " %q" "$arg"`
|   done
|   exec /usr/bin/login -pqf "$USER" "$SHELL" -c "$qcmd"
| 
| (That's bash instead of sh purely to use the %q printf extension.)
| It correctly preserves command line strings while still using your
| /usr/bin/login incantation to obtain the environment in a shell
| independent manner.

We would need to check the bash's %q escaping is suitable for [t]csh and
es and rc. It should be good for all the Bourne shells.
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/


More information about the Xquartz-dev mailing list