Re: passing args without eval
- From: Ed Morton <mortonspam@xxxxxxxxx>
- Date: Mon, 23 Jan 2012 08:54:18 -0600
On 1/23/2012 8:29 AM, Stephane Chazelas wrote:
2012-01-23 08:20:21 -0600, Ed Morton:
[...]
[af] ) optArgs[$OPTIND]="$OPTARG"[...]
passargs="$passargs -$opt \"\${optArgs[$OPTIND]}\""
eval "sub $passargs \"\$@\""[...]
If you're using arrays already, why are you using a scalar for
$passargs?
passargs+=("-$opt" "$OPTARG")
[...]
sub "$passargs[@]"
(zsh syntax).
In case anyone cares, I found with bash I need to add curly braces:
sub "${passargs[@]}"
I assume that'll work in zsh too.
Thanks again,
Ed.
.
- References:
- passing args without eval
- From: Ed Morton
- Re: passing args without eval
- From: Stephane Chazelas
- Re: passing args without eval
- From: Ed Morton
- Re: passing args without eval
- From: Ed Morton
- Re: passing args without eval
- From: Kaz Kylheku
- Re: passing args without eval
- From: Ed Morton
- Re: passing args without eval
- From: Stephane Chazelas
- passing args without eval
- Prev by Date: Re: passing args without eval
- Next by Date: Re: passing args without eval
- Previous by thread: Re: passing args without eval
- Next by thread: Re: passing args without eval
- Index(es):
Relevant Pages
|