Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library

Comment by nurettin

16 hours ago

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

    foo &> file  
    foo |& program

2 comments

nurettin

Reply

rezonant  16 hours ago

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_pomu  15 hours ago

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

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities