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

Re: brace expansion not happening



Carlos Carvalho <carlos@xxxxxxxxxxxxxx>:
> I need to do an expansion in more than one place, so I'd like to put
> the pattern in a variable. However it's not equivalent:
[...]
> Putting in a variable:
> 
> % list=a/{b,c}-d
> %  for i in $list; do echo $i; done
> a/{b,c}-d

Use an array:
% list=(a/{b,c}-d)

The rest just work, just as you wrote it.

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925



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