[prev] 35 [next]

Unix Pipes

  • Unix shells allow you to connect stdout of one program to stdin of another program
  • Run a.out with stdout going to stdin of wc

    ./a.out | wc -l
    

  • wc counts chars, words and lines in its stdin
  • Unix other useful programs (filters) designed to be run like wc
    E.g.: grep, cut, sort, uniq