|
| From: | Paul Jarc |
| Subject: | Re: Weird quoting issue with spaces |
| Date: | Wed, 07 Apr 2004 11:11:28 -0400 |
| User-agent: | Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (gnu/linux) |
"Brian J. Murrell" <brian@interlinx.bc.ca> wrote:
> opt_arg="opt arg"
> opt="--opt \"$opt_arg\""
>
> a_command $opt
All untested...
opt_arg="opt arg"
opt='--opt "$opt_arg"'
eval a_command $opt
Or:
opt_arg="opt arg"
opt=(--opt "$opt_arg")
a_command "${opt[@]}"
Or:
set -- "opt arg"
set -- --opt "$@"
a_command "$@"
The second one won't work with many other shells.
paul
| [Prev in Thread] | Current Thread | [Next in Thread] |