On ���, 2002-01-10 at 21:12, Guillaume Cottenceau wrote:
> Borsenkow Andrej <[EMAIL PROTECTED]> writes:
> 
> [...]
> 
> > > use
> > > startx "KDE 3"
> > > or
> > > startx 'KDE 3'
> > 
> > Are you serious? 
> 
> Yes -- why ?
> 

Because why should users go into trouble of typing extra characters
while there is absolutely no real reasons to keep this name?

> 
> [...]
> 
> > If "or not" is related to "should it work" - it should. If it is related
> > to "does it work" - of course not. Startx does not extra quote its
> > arguments.
> 
> ?? Then it's because startx (or other subscripts) is bugged. The
> shell honours quotes and gives you the awaited nice string as
> first arg of prog :
> 

No it is not bugged. It is the basic shell design that is flawed.

startx build argument list like (very approximately)


for i in "$@"

arglist="$arglist $i"

- at this step distinction between one argument "KDE 3" and two
arguments "KDE" "3" disappears - 

and then calls xinit with

xinit $arglist

- it must call it without quotes to be able to pass multiple arguments -

To preserve arguments with spaces you need something like

for i in "$@"
 arglist="$arglist \"$i\""

eval "xinit $arglist"

But why do this if you never actually expect arguments with spaces in
them?


Use zsh and avoid all these troubles :-)

> [gc@obiwan ~] ruby -e 'puts ARGV[0]' firstarg
> firstarg
> [gc@obiwan ~] ruby -e 'puts ARGV[0]' first arg
> first
> [gc@obiwan ~] ruby -e 'puts ARGV[0]' "first arg"
> first arg
>

It is not a problem.

-andrej

Reply via email to