[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `&>' doesn't behave as expected in POSIX mode
From: |
Chet Ramey |
Subject: |
Re: `&>' doesn't behave as expected in POSIX mode |
Date: |
Mon, 21 Jun 2021 09:52:40 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 |
On 6/20/21 4:05 AM, Oğuz wrote:
$ set -o posix
$ uname &>/dev/null
$
`uname &' and `>/dev/null' should be parsed as two separate commands;
that, if I'm not missing anything, is what POSIX says. But bash
doesn't do that in POSIX mode, and redirects both stderr and stdout to
`/dev/null'.
You're right, and it's not worth changing at this point. It's come up
before, and the bash interpretation is much more useful and compatible.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/