title: Redirect cat output to bash script
body: <p>I need to write a bash script, which will get the subdomains from &quot;subdomains.txt&quot;, which are separated by line breaks, and show me their HTTP response code. I want it to look this way:
  <br><code>cat subdomains.txt | ./httpResponse</code></p>
  <p>The problem is, that I dont know, how to make the bash script get the subdomain names. Obviously, I need to use a loop, something like this:</p>
  <pre><code>for subdomains in list
  do
      echo curl --write-out &quot;%{http_code}\n&quot; --silent --output /dev/null &quot;subdomain&quot;
  done
  </code></pre>
  <p>But how can I populate the list in loop, using the <strong>cat</strong> and <strong>pipeline</strong>? Thanks a lot in advance!</p>