- 论坛徽章:
- 0
|
请问一个SHELL
Hi,
To explain the \"2>;&1\", the best way is to use an example:
# ls /home/laoli/nosuchfile >; /tmp/output 2>;&1
The above command says: list the file /home/laoli/nosuchfile, save the output (standard output; in Unix the file descriptor is \"1\" to a file called /tmp/ouput; if there is any error in the process, save the error (standard error; in Unix the file descriptor is 2) to the standard output also. (In this case, since the standard output is already sent to /tmp/output, therefore the error will be sent to /tmp/output too).
Hope this helps. |
|