[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: small fix for Debian AMD64 HowTo



Bob Proulx wrote:
> Sebastian Kuegler wrote:
>> exec dchroot -c ia32 -d "$(basename $0) $@
>>                                        ^
>> So the command with arguments gets passed into the chroot, rather than be
>> interpreted as arguments of the dchroot program.
> 
> I am sure you meant to include the final " on the end of that line.

Yes, typo. :> 

> Actually the problem is the additional interpretation by 'su' in the
> chroot.  So it is the 'su' command that is seeing the option.
> 
> There is a subtle difference between "$@" and "$*".  The first quotes
> all arguments individually and the second groups them all together.
> Normally shell scripts should use "$@" to preserve arguments exactly
> when passing them allong in wrappers.  But due to a deficiency in
> dchroot this does not work.
>
> I am thinking the following is really what you were trying to say.
> But actually I don't like it.  I would rather see dchroot improved
> intead.

Of course, fixing dchroot would be nicer. Having this worked around in the
meantime is also a good thing (tm) of course.

>   exec dchroot -c ia32 -d "$(basename $0) $*"

Works, indeed. The following (suggested to me in private email) does also
work:
exec dchroot -c ia32 -d "$(basename $0)" -- "$@"

Thanks for the suggestions!

> Bob

sebas
-- 
http://vizZzion.org
======================
Your conscience never stops you from doing anything.  It just stops you from
enjoying it.





Reply to: