[Xquartz-dev] 2.3.2_rc4

Martin Costabel costabel at wanadoo.fr
Sun Dec 21 08:19:32 PST 2008


Harald Hanche-Olsen wrote:
> 
> + Martin Costabel <costabel at wanadoo.fr>:
> 
>> Would you guys please make some tests before lecturing ;-)
> 
> There is no need to run a test to know that an unquoted variable 
> reference will expand to several words in the shell, if there are spaces 
> in the value of said variable. Neither do you need to run a test to know 
> that an unmatched quote character spells trouble.

The problem with spaces in the directory name is not the problem we were 
discussing here. Jeremy's wrapper script in rc4 has this problem, as has 
my wrapper script. If you find a solution for it, it will be welcome. We 
were discussing the problem of getting a login environment for users 
that don't have bash as login shell.

>> As I repeatedly wrote here (and I am used to making tests before 
>> making claims):
>> [...]
>> 2. The commands like args="${@}" are *necessary* for this to work with 
>> a tcsh startup shell. Otherwise X11 crashes with errors like what I 
>> showed before:
>>
>>> 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.
> 
> But you never showed us exactly what you did to get that (very strange) 
> error.

I did. As I wrote when I reported this first, I used the wrapper script 
with the ~/.x11run hook (which comes from you, as I see now), and placed 
Peter's script

> #! /bin/bash
> exec -l "$SHELL" "$@" 

into ~/.x11run. Then click on the X11.app icon. The same error messages 
show up in console.log if you use my wrapper script and place the 
variables "$(dirname $0)"/X11.bin and "${@}" directly on the "exec -l" 
line without first changing their names to something a non-bash shell 
can understand. My tentative explanation is that the "exec -l" replaces 
bash by $SHELL before expanding those variables, so that they are left 
to tcsh for expansion. I have not yet tried to decipher 
"\312\376\272\276^B^G^C^P^Z\2120^L^R". Unicode, perhaps?

>> Likewise, the situation where X11.app is in a directory with spaces or 
>> other garbage in its name: In this case, my wrapper script works as 
>> well as Jeremy's that comes with 2.3.2-rc4 or the one he proposed with 
>> the ~/.x11run hook: namely not.
> 
> That was my proposal. Why doesn't it work?

OK, I see that it was you who proposed it. It doesn't work when X11.app 
is in a directory with spaces in its name. Whether ~/.x11run is present 
or not. Just try it. You (or at least I) get the console message:

> 21/12/08 17:08:23 [0x0-0xe50e5].org.x.X11[24266] usage: dirname path 
> 21/12/08 17:08:23 [0x0-0xe50e5].org.x.X11[24266] /Applications with a space/X11.app/Contents/MacOS/X11: line 6: /X11.bin: No such file or directory 

[]
> I'm glad that you found a solution that works for you. Jeremy, however, 
> faces the much more challenging problem of finding a solution that will 
> work for everybody. In that case, worrying about spaces and quotes in 
> pathnames is hardly hair splitting.

But Jeremy has not asked for help with the spaces-in-names problem. He 
asked for help with the login-environment-for-tcsh-users problem. This 
is the one I helped with.

-- 
Martin


More information about the Xquartz-dev mailing list