问题
Sorry for posting it here, but Google does a very bad job when searching for symbols.
What does the "|" mean in:
"some string" | someexecutable.py
回答1:
It is the pipe symbol. It separates two programs on a command line (see Pipelines in the bash manual), and the standard output of the first program (on the LHS of the pipe) is connected to the standard input of the second program (on the RHS of the pipe).
For example:
who | wc -l
gives you a count of the number of people or sessions connected to your computer (plus one for the header line from who). To discount the header line:
who | sed 1d | wc -l
The input to sed comes from who, and the output of sed goes to wc.
The underlying system call is pipe(2) used in conjunction with fork(), dup2() and the exec*() system calls.
回答2:
It's called pipe. It gives the stdout of the first command ("some string") as the stdin to the second command (someexecutable.py).
回答3:
| is a pipe. It sends output of one command as input of the next. It is explained here http://www.ibm.com/developerworks/linux/library/l-lpic1-v3-103-4/#3-pipes
来源:https://stackoverflow.com/questions/12400371/what-does-mean-in-a-terminal-command-line