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

Re: brace expansion question



On Apr 12,  6:13pm, grover mitchell wrote:
} 
} foo1{01..10}
} bar2{01..10}
} 
} Is there any way to have zsh do a brace expansion on the contents of
} this file?

On Apr 13,  2:20pm, Eric Mangold wrote:
}
} Unfortunately, I don't see a parameter expansion flag that performs
} brace expansion on the result. It seems like there ought to be one.

Paramter expansion happens before brace expansion in normal evaluation
order, so it'd be sufficient if the tilde flag made braces eligible for
interpretation as it does with glob metacharacters.  The reason it does
not is mostly historical, but also for compatibility bash.  (I notice
that tcsh expands braces that result from parameter expansion.)

} Perhaps the "e" flag should also do brace expansion [...] there is
} probably a good reason it doesn't.

The operations enabled by (e) all have the same evaluation order as
parameter expansion (that is, they're done left to right as the parser
encounters them).

On Apr 13,  1:18pm, Mariusz Gniazdowski wrote:
} Subject: Re: brace expansion question
}
} Day Wed, Apr 13, 2005 at 10:03:15AM +0200, DervishD:
} >     cat file | while read line ; eval print $line
} 
} It can be done without cat:
} { while read line ; eval print $line } < file

Or even

  while read line; do eval print $line; done < file

(which doesn't require the SHORT_LOOPS setopt).



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