Search code examples
bashstdoutstderrtcsh

What does >>& mean in a tcsh script and how does it translate to bash?


I'm converting a tcsh script to bash, hit a snag because I'm not entirely sure what >>& does

wget --output-document=/dev/null "http://somewebsite.org" >>& /root/wget.log

I did read the man-page http://linux.die.net/man/1/tcsh but not sure what "route the diagnostic" means, probably stderr...

so, just to be absolutely sure, is it the same as doing:

wget --output-document=/dev/null "http://somewebsite.org" 2>>&1 /root/wget.log

in a bash script?


Solution

  • It appends both stdout and stderr to the file, so it's equivalent to:

    wget --output-document=/dev/null "http://somewebsite.org" >> /root/wget.log 2>&1