zsh-workers
 help / color / mirror / code / Atom feed
* Redirection order with multios option set
@ 2016-04-04 10:27 Cuong Manh Le
  2016-04-04 10:53 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Cuong Manh Le @ 2016-04-04 10:27 UTC (permalink / raw)
  To: Zsh hackers list

[-- Attachment #1: Type: text/plain, Size: 697 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-04 11:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-04 10:27 Redirection order with multios option set Cuong Manh Le
2016-04-04 10:53 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).