bug-bash
[Top][All Lists]
Advanced

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

Re: Weird quoting issue with spaces


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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]