LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Could someone please tell me what this means!!!!! (https://www.linuxquestions.org/questions/programming-9/could-someone-please-tell-me-what-this-means-1526/)

brianm 03-27-2001 06:27 PM

Could someone please tell me what this means i see it in a lot of scripts but i don't know what it does and i can't find anything about it in any of my books or on any websites?

the command is:
2>&1

Thanks a lot.

crabboy 03-27-2001 11:05 PM

It redirects both stdout and stderr. This is directly from the bash man page.

Quote:

Redirecting Standard Output and Standard Error
Bash allows both the standard output (file descriptor 1)
and the standard error output (file descriptor 2) to be
redirected to the file whose name is the expansion of word
with this construct.

There are two formats for redirecting standard output and
standard error:

&>word
and
>&word

Of the two forms, the first is preferred. This is seman-
tically equivalent to

>word 2>&1


All times are GMT -5. The time now is 03:28 AM.