Subject: Redirection order with multios option set
From: Cuong Manh Le <[email-masked]>
To: Zsh hackers list <[email-masked]>
Date: Mon, 4 Apr 2016 17:27:30 +0700
List-Id: Zsh Workers List <zsh-workers.zsh.org>

When multios option is set, the below two command are equivalent:

$ echo a >/tmp/test >/tmp/test1
$ echo a >/tmp/test1 >/tmp/test

Both command write `a` to `/tmp/test` and `/tmp/test1`.

Now to simulate `tee` command:

$ echo a >&1 >/tmp/test

or:

$ echo a >/dev/stdout >/tmp/test

work as expected, `a` was written to standard output as well as
`/tmp/test`. But swapping the redirection order produce different behavior:

$ echo a >/tmp/test >&1

write two lines `a` to file `/tmp/test`.

>From user perspective, this behavior seems to be in-consistent to me.

I read the documentation but find no information about this case. Is this
behavior intended?

Cuong Manh Le
https://cuonglm.xyz