zsh-workers
 help / color / mirror / code / Atom feed
From: Cuong Manh Le <cuong.manhle.vn@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Redirection order with multios option set
Date: Mon, 4 Apr 2016 17:27:30 +0700	[thread overview]
Message-ID: <CALS7p_ciMrR6H2VL7Wh0_+fex44eeDwYf0h1Csunn30w0oLGYQ@mail.gmail.com> (raw)

[-- 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

             reply	other threads:[~2016-04-04 10:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-04 10:27 Cuong Manh Le [this message]
2016-04-04 10:53 ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALS7p_ciMrR6H2VL7Wh0_+fex44eeDwYf0h1Csunn30w0oLGYQ@mail.gmail.com \
    --to=cuong.manhle.vn@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).