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 9645
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Forcing expansion without explicit eval nor a subshell?
- Date: Sat, 05 Nov 2005 21:33:14 +0000
- In-reply-to: <m3d5lezwu7.fsf@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <m364r73fpp.fsf@xxxxxxxxxx> <1051105195640.ZM24493@xxxxxxxxxxxxxxxxxxxxxxx> <m3d5lezwu7.fsf@xxxxxxxxxx>
On Nov 5, 3:03pm, Lloyd Zusman wrote:
}
} I want to defer it in case I do this:
}
} yumargs='--disablerepo={dag,$livnastuff}'
}
} ... where $livnastuff can change, and where it might or might not
} involve more brace expansions.
The answer is still to stop thinking about brace expansions and start
thinking about array expansions.
yumargs=( --disablerepo={dag,'$^livnastuff'} )
livnastuff=( dries extras )
yum ${(e)yumargs}
You can keep abstracting this out:
reponames=( dag '$^livnastuff' )
yumargs=( --disablerepo=$^reponames )
livnastuff=( dries extras )
yum ${(e)yumargs}
Or
pkgnames=( kernel '$^livnapkgs' )
reponames=( dag '$^livnarepos' )
yumargs=( --exclude='${(e)^pkgnames}' --disablerepo='${(e)^reponames}' )
livnarepos=( dries extras )
yum ${(e)yumargs}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author