How to pipe in the result of another UNIX command How to pipe in the result of another UNIX command unix unix

How to pipe in the result of another UNIX command


Pipes are your friend:-

cat text | tr -d "[,|.]" | tr "[A-Z]" "[a-z]" >result.txt


Try:

  1. tr -d "[,|.]" < text | tr "[A-Z]" "[a-z]" > result.txt
  2. cat text | tr -d "[,|.]" | tr "[A-Z]" "[a-z]" > result.txt

Both commands do the same job.

What pipe(designated by |) does, is just redirects output of one command to the input of another. So, for example, in foo | bar the output of foo gets redirected into input of bar.