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

Re: PATCH: function parsing

Bart Schaefer wrote:
> While you're at it, any chance you can "fix" redirections following a
> function definition?  E.g. per ksh (and possibly per posix) this:
> 	func() { less } < /etc/termcap
> should be equivalent to this:
> 	func() { { less } < /etc/termcap }

I've played with it for a little without success.

I've come to the conclusion the only way to do it will be to rewrite it
internally exactly how you've shown it --- i.e. insert a current-shell
construct (the normal effect of braces) inside the list construct and
attach the redirection to that, but it's a bit of a mess unless we
always parse functions as a current-shell construct.

Maybe later.

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 392070

The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
If you received this in error, please contact the sender and 
delete the material from any computer.

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