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

Re: <> redirection operator (was: zsh.texi)



> >I agree with that but I'm afraid that this change will break many scripts.
> >But it would be definitely simpler and cleaner, and the documentation would
> >be much simpler and less confusing.
> 
> How often do you use numerical globbing?  I've only ever used it
> interactively.  It wouldn't be the first time we've changed behaviour,
> and the change required to scripts is trivial.

I decided: in beta21, <> will always do redirection.

> And regarding the &> redirection you mentioned: I think this is a bad
> idea.  It's not POSIX conformant (consider `a &> b c`), and it's not

Yes, a &> b c will work differently from what POSIX requires but a & > b c
will be OK.  I do not think that there is any script which contains
adjacent & and >.

> really necessary.  It is possible to redirect to a file called "-" by
> doing `>& ./-`.

The biggest problem is when you use parameter expansion.  When you write
>& $foo you cannot tell in advance wether the output will be closed or if
it goes to a file, or to an other file descriptor or to the coprocess.

Implementing &> is very simple and I do not think that it conflicts with
any scripts (and a portable script which expects POSIX behaviour should not
use &> anyway since bash uses it for redirectiog standard output and
error which means that such a script will not work under Linux).

Zoltan




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