I have never been familiar with Shell and used to write command> log. log 2> & 1 when reporting error logs.
Today, a colleague read my shell script and asked me what I meant by 2> & 1, which really gave me a hard time.
After Google, I have a rough understanding:
The default standard shell input is the keyboard, or you can try files or pipelines |
By default, the standard output can be a terminal, a file, or a media transcoding queue.
Standard errors are also terminal errors by default. You can try files.
Standard input, output, and error output indicate stdin stdout stderr, respectively, or 0 1 2.
With the above explanation, you will understand
Make-J8> make. log. $2> & 1
2> indicates the redirection of the standard output.
& Is equivalent
2> & 1 indicates that the standard error output is equivalent to the standard output.
Make-J8> make. log. $2> & 1, that is, both the standard output and the standard error output are input to the make. log.3850 file.