
On 02.05.12 16:49, Chris Samuel wrote:
I'm banging my head against how to properly pass a list of arguments in a variable through to a command in bash where the list of arguments itself has quoted values in it.
Maybe I'm missing something, but if the enclosing single quotes need to be omitted, as in the dash example, then why not just omit them?: $ a=--debug --make-maker=--make-maker="INSTALLDIRS=vendor \ INSTALLMAN1DIR=none INSTALLMAN3DIR=none" --no-sign $ echo cpan2rpm $a cpan2rpm --debug --make-maker=--make-maker="INSTALLDIRS=vendor INSTALLMAN1DIR=none INSTALLMAN3DIR=none" --no-sign If, on the other hand, it's the weird placement of the single quotes which offends, then instead of trying to carry them over, I'd just place them where and when needed: $ echo cpan2rpm \'$a\' cpan2rpm '--debug --make-maker=--make-maker="INSTALLDIRS=vendor INSTALLMAN1DIR=none INSTALLMAN3DIR=none" --no-sign' Is that getting anywhere near understanding the problem? Erik