 <p>Can't you send the commands to the background with &amp; in order to process the others simultaneously? Something like below;</p> <pre><code>#!/bin/bash ports="20 21 22 25 80 443" for p in $ports do nmap -Pn -p$p 10.0.1.0/24 &amp; done </code></pre>