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

Re: I/O redirection problem in "zsh"



On 25 Oct, you wrote:
> 
> the I/O redirection in the following command doesn't work properly in "zsh":
> 
> grep localhost /etc/hosts fasel 2>&1 >/dev/null | cat -b
> 
> tron@colwyn:~>grep localhost /etc/hosts fasel 2>&1 >/dev/null | cat -b
>      1  grep: fasel: No such file or directory
>      2  /etc/hosts:::1                                  localhost
>      3  /etc/hosts:127.0.0.1                            localhost

This is an effect of the multios option. If you do an unsetopt multios,
it will work the same as in sh. Multios allows shorthands for the tee
command so the output above is sent to both /dev/null and the pipe which
you can see if you use a file instead of /dev/null.

Oliver

This e-mail and any attachment is for authorised use by the intended recipient(s) only.  It may contain proprietary material, confidential information and/or be subject to legal privilege.  It should not be copied, disclosed to, retained or used by, any other party.  If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.  Thank you.



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