logoalt Hacker News

nurettinyesterday at 11:02 PM2 repliesview on HN

I saw this newer bash syntax for redirecting all output some years ago on irc

    foo &> file  
    foo |& program

Replies

rezonantyesterday at 11:14 PM

I didn't know about |&, not sure if it was introduced at the same time. So I'd always use &> for redirection to file and 2>&1 for piping

ndsipa_pomutoday at 12:13 AM

I think the "|&" is the most intuitive syntax - you can just amend an existing pipe to also include STDERR