Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Redirection order with multios option set
- X-seq: zsh-workers 38235
- From: Cuong Manh Le <cuong.manhle.vn@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Redirection order with multios option set
- Date: Mon, 4 Apr 2016 17:27:30 +0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=B05DncAbM4QdGBwqCarD1DMwobkP1ngrJixNBDhWdos=; b=DurNYYqN0bB541rZi6kay/a/e/srqF8OfQP1+0SKMDlH9xu9q72q3iOEdFr2m5ANkb APQw5JuWKQ0FZ6F3E0RzDDVlZl+I9GEDwFKOihQVn+p/PLG/phE0xiHIDgG+nIrClslf Bd7Qt0oVlWeFf1VYT28JwKeL8ijP7qSNZpD2Xpi187+fHt88URoRushckaFjpbEJjdgH 3Kb+fdgikUIsdB3UqH18iGgMz3r3MsBZaq/ZYCu/2GmJlFJg95pF9Vie6aL9HwE6qurl Pxb/xFWE8xvKK84I2OVtXnGtW7B8zLjdc3tT6O1O4No6vuDS07Es92iBYhT/cEWoT6y2 keew==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author