logoalt Hacker News

tempodoxtoday at 5:44 AM2 repliesview on HN

That’s nothing, try `&>`.


Replies

jolmgtoday at 9:58 AM

Also known as `>&`.

  cmd >&out-and-err.txt
oguz-ismail2today at 8:16 AM

This is one of those places where Bash diverges from POSIX. The standard says `echo &>/dev/null' is two commands, namely `echo &' and `>/dev/null', but Bash interprets it as redirect both stdout and stderr of `echo' to `/dev/null' both in normal and POSIX mode.