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

Re: passing argument with brace expansion to script



Ken Irving wrote:
On Sun, Jan 13, 2008 at 07:59:52PM +0100, Andreas Berglund wrote:
Hi!
I have a script to which I would like to pass an argument that contains brace expansion, but I want the expansion to be evaluated in the script, not before it gets passed along. Does annyone know how to do that?

Generally single or double quotes will "protect" arguments against
expansion in a shell command.  The quotes are removed in the process,
so the arguments should be available separately inside the script. Bash brace expansion is kind of a special case, though, and I'm not
sure it'll work this way...  Some simple tests would answer the question.

Ken


I have tried the traditional techniques with quotes, single and double, and backslashes and it does get the argument to the script unchanged, but then it won't get evaluated in the script for some reason, perhaps it's not possible?


Reply to: