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

Re: brace expansion not happening



On Thu, 8 Jan 2009, Frank Terbeck wrote:

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.


This seems fine for the original question. But, how about the case of user input?

e.g.

$ read R

## user enters: a/{b,c}-d

Is there then no way to do brace expansion on R?

Best,
Ben



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