Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	HTML_MESSAGE,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1
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==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
        bh=B05DncAbM4QdGBwqCarD1DMwobkP1ngrJixNBDhWdos=;
        b=ZDVpnBo70CGq7Ad3WJ9b/EQIwBACPHOmNdWkLzoSnfQRAwTlgzlW9irC5N/wuNrW5z
         6rQ4dDR+3O+SakqUITkSSl8c0Pn1znx6Ol9kbaQGl0sVF2TdOTkArcnLBfNNPsC67btj
         JX4vDCvLIrPW9JdGaR9B0HI+Z3pyzExVNkPMmtRC6WvO8uSGVJsl977An6zj4fQiyrgz
         CDlaRRkOG8/OZkBc10aVJHFwZ+uRRf0THqjyFEO+HthDcpHBH2hp8guxpITUBQP8Vj3W
         lre1BoHFQZSAVXX/7hbQLyJDPdG1C1OTjdQDPxl6KXAT7ntVAZ/9N3N+hCZDz3l5oXgu
         c0Bg==
X-Gm-Message-State: AD7BkJLECHoVjHR6AxsmxJM2g/HxzgK7PBMVzAcLyFmDbKvaSkyYUyWtdXCWi5K6QEHWrj3ctEGbKY5jkmPa2g==
X-Received: by 10.194.122.138 with SMTP id ls10mr17494047wjb.51.1459765689898;
 Mon, 04 Apr 2016 03:28:09 -0700 (PDT)
MIME-Version: 1.0
From: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Date: Mon, 4 Apr 2016 17:27:30 +0700
Message-ID: <CALS7p_ciMrR6H2VL7Wh0_+fex44eeDwYf0h1Csunn30w0oLGYQ@mail.gmail.com>
Subject: Redirection order with multios option set
To: Zsh hackers list <zsh-workers@zsh.org>
Content-Type: multipart/alternative; boundary=089e012284a666dc88052fa62faf
X-Seq: zsh-workers 38235

--089e012284a666dc88052fa62faf
Content-Type: text/plain; charset=UTF-8

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

--089e012284a666dc88052fa62faf--

