Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: order of processing in brace expansion



On May 11,  1:22pm, Allan Poindexter wrote:
> 
> I don't see any way to parameterize patterns for brace expansion if
> this is [not] done. (E.g. setting a parameter in a script to a pattern
> that will be used in brace expansion in several places and which may
> need to be changed from time to time. IMO is a good thing to be able
> to do). Am I overlooking something? Is there some other way to do
> this?

Brace expansion is completely equivalent to expanding an array parameter
with rc_expand_param set.  So instead of

	alternates=x,y,z
	echo foo/{$alternates}/bar

you do

	alternates=(x y z)
	echo foo/$^alternates/bar

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author