Original address: http://blog.csdn.net/wirelessqa/article/details/8968381
A. Pipeline command
The pipe command operator is: "|", which can only handle the correct output information that is transmitted through the previous instruction, and has no direct ability to handle the error information. Then, pass to the next command as the standard input.
The output description of the management command:
"Instruction 1" is the correct output, as the input of "instruction 2" and then the output of "instruction 2" as "instruction 3" input, "instruction 3" output will be directly displayed on the screen.
The correct output of "instruction 1" and "instruction 2" is not displayed on the screen after the pipeline is passed
"Reminder Note":
1. The pipeline command only handles the correct output of the previous command and does not handle the error output;
2. Pipeline command to the right, must be able to receive the standard input stream command;
two. Give me a chestnut.
#1. Read the contents of the Logcat.log file and send it through the pipeline to grep as input
#2. Read the contents of the Logcat.log file, transfer the pipe to grep as input, filter the rows containing ' displayed ', and forward the output to the next grep as input.
#3. Read the contents of the Logcat.log and Wirelessqa.log files, the contents of the error will be printed on the screen, and the correct will pass to grep through the pipe
#4. Read the contents of the Logcat.log and Wirelessqa.log files, the contents of the error are redirected to the/dev/null, and the correct channel is passed to grep
#5. read out logcat.log to LS via pipeline, because LS does not support standard input, so the data read before is lost