Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Forcing expansion without explicit eval nor a subshell?
- X-seq: zsh-users 9649
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Forcing expansion without explicit eval nor a subshell?
- Date: Sun, 06 Nov 2005 03:02:16 +0000
- In-reply-to: <m33bmaycil.fsf@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <m364r73fpp.fsf@xxxxxxxxxx> <1051105195640.ZM24493@xxxxxxxxxxxxxxxxxxxxxxx> <m3d5lezwu7.fsf@xxxxxxxxxx> <1051105213315.ZM24679@xxxxxxxxxxxxxxxxxxxxxxx> <m33bmaycil.fsf@xxxxxxxxxx>
On Nov 5, 5:07pm, Lloyd Zusman wrote:
}
} I can't figure out how to do the nesting stuff using arrays, without
} things getting rather complex.
You do end up needing one array for each level of nesting.
E.g.:
yumargs=( --disablerepo='${(e)^disablerepos}' )
disablerepos=( dag '${(e)^livnarepos' )
livnarepos=( livna{,-updates,-extras,-testing} )
yum ${(e)yumargs}
This corresponds to your example
yum --disablerepo={dag,livna{,-updates,-extras,-testing}}
The extra arrays are the price you pay for wanting to avoid defining
e.g. $livnarepos until the last minute and also avoid eval.
You might also ask yourself whether there's another way to get the end
result that you want, such as writing a wrapper function around yum.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author