title: cat file_name | grep "something" results "cat: grep: No such file or directory" in shell scripting
body: <p>I have written shell script which reads commands from input file and execute commands. I have command like: </p>
  
  <pre><code>cat linux_unit_test_commands | grep "dmesg" 
  </code></pre>
  
  <p>in the input file. I am getting below error message while executing shell script:</p>
  
  <pre><code>cat: |: No such file or directory
  cat: grep: No such file or directory
  cat: "dmesg": No such file or directory
  </code></pre>
  
  <p>Script:</p>
  
  <pre><code> #!/bin/bash
  
   while read line
   do
       output=`$line`
       echo $output &gt;&gt; logs
   done &lt; $1
  </code></pre>
  
  <p>Below is input file(example_commands):</p>
  
  <pre><code>ls
  date
  cat linux_unit_test_commands | grep "dmesg"
  </code></pre>
  
  <p>Execute: ./linux_unit_tests.sh example_commands</p>
  
  <p>Please help me to resolve this issue.</p>