title: Bash script: read 30000 records from file and run multiple process in parallel
body: <p>txt with more than 30000 records.
  All records are one for line and is an IP like this:</p>
  <pre><code>192.168.0.1
  192.168.0.2
  192.168.0.3
  192.168.0.4
  192.168.0.5
  192.168.0.6
  192.168.0.7
  192.168.0.8
  192.168.0.9
  192.168.0.10
  </code></pre>
  <p>I read each row in a bash script, and I need to run a curl like this:</p>
  <pre><code>while IFS= read -r line || [[ -n &quot;$line&quot; ]]; do
      #check_site &quot;$line&quot;
      resp=$(curl -i -m1 http://$line 2&gt;&amp;1)
      echo &quot;$resp&quot; | grep -Eo &quot;$ok&quot; &gt; /dev/null
  
      if [ $? -ne 0 ]; then
          #echo -e &quot;failed: $line&quot; &gt;&gt; &quot;${logfile}&quot;
          echo -e &quot;Command: curl -i -m1 http://$line 2&gt;&amp;1&quot; &gt;&gt; &quot;${outfile}&quot;
          echo -e &quot;failed: $line:\n\n \&quot;$resp\&quot;\n\n&quot; &gt;&gt; &quot;${outfile}&quot;
          echo &quot;$line&quot; &gt;&gt; &quot;${faillog}&quot;
      fi
  done &lt; &quot;${FILE}&quot;
  </code></pre>
  <p>Is there a method to run multiple lines simultaneously in my file to reduce the execution time?</p>