Sometimes we use pipe symbol for mathematical expression, sometimes we use for execute two or more command at time,but what this actually is ? What is the main use of this symbol in script ?
Asked
Active
Viewed 232 times
1 Answers
0
The pipe lets you direct the output of one command into another command. That is the stdout of the command on the left hand side becomes the stdin of the command on the right hand side. You can then chain commands together to make a script (or as I like to call it, an uber command). This is very powerful stuff and is quite fun to do. For example, during the Wordlcup I tasked myself with finding out the score of the Brazil match just using my command line. I was able to pipe commands together till and get my answer. Started with a "curl http://sports.yahoo.com" and piped the output to a combination of grep and awk commands.

Jose Martinez
- 11,452
- 7
- 53
- 68
# echo "$a + $b" | bc
16.3
i think those are floating value.. @CharlesDuffy – Mastan Mar 16 '15 at 19:22