Oğuz <oguzismailuy...@gmail.com> writes:
>     $ 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'.

An interesting point!  At least according to the 2018 edition, a Posix
shell parses that command as

    uname
    &
    >
    /dev/null

which is two commands, "uname &" and ">/dev/null".  The second command
is a no-op.  Whereas default mode Bash parses it as uname with a
redirection.

This may be the only situation where Posix mode differs from default
mode in *lexing*.  And at least in my antique version, the --posix
switch doesn't make that change.

Dale

Reply via email to