
On Wed, May 02, 2012 at 09:14:17PM +1000, Matthew Cengia wrote:
* Which versions of bash and dash are you using on each host?
someone already mentioned that it worked as expected with RHEL bash 4.1.2(1)-release and Debian bash 4.2.5(1)-release. OTOH, it's pretty easy to read the wrong line in the ouput and read the echo output instead of the '+' trace output....i've done that twice so far this morning (perhaps due to ENOCOFFEE), and initially thought that the bash versions on sid and precise were working as expected, until i looked again and realised they weren't. I'm getting the same symptoms as Chris with debian sid's bash version 4.2.20(1)-release and the same on Ubuntu Precise with bash 4.2.24(1)-release, so maybe there's a bug with 4.2.20 (or thereabouts) and later. quoting in sh and bash has always been a PITA, but this seems just broken.
* 'echo' will theoretically expand the quotes, and therefore you won't see how the arguments actually get passed to cpan2rpm.
i've also tried it with /bin/echo rather than the builtin echo - same result, so it's not echo expanding the quotes, it's bash itself. hmmm. compare the difference between using echo and "cat <<__EOF__" #!/bin/bash a='--debug --make-maker=--make-maker="INSTALLDIRS=vendor INSTALLMAN1DIR=none INSTALLMAN3DIR=none" --no-sign' echo cpan2rpm $a cat <<__EOF__ cpan2rpm $a __EOF__ $ bash -x /tmp/quote.sh + a='--debug --make-maker=--make-maker="INSTALLDIRS=vendor INSTALLMAN1DIR=none INSTALLMAN3DIR=none" --no-sign' + echo cpan2rpm --debug '--make-maker=--make-maker="INSTALLDIRS=vendor' INSTALLMAN1DIR=none 'INSTALLMAN3DIR=none"' --no-sign cpan2rpm --debug --make-maker=--make-maker="INSTALLDIRS=vendor INSTALLMAN1DIR=none INSTALLMAN3DIR=none" --no-sign + cat cpan2rpm --debug --make-maker=--make-maker="INSTALLDIRS=vendor INSTALLMAN1DIR=none INSTALLMAN3DIR=none" --no-sign (i've added extra lines to make it more readable) that looks OK, so maybe running the cpan2rpm command with eval or in a sub-shell would work. craig -- craig sanders <cas@taz.net.au> BOFH excuse #351: PEBKAC (Problem Exists Between Keyboard And Chair)