for ip in $( nmap -sL -oG - 37.9.0.0/24 | grep -v "#" | cut -d " " -f 2 ) do curl --connect-timeout 3 --output $ip.txt http://$ip:631/printers & done for range in $(cat list.txt); do for ip in $(nmap -sL -oG - $range) | grep -v "#" | cut -d " " -f 2; do curl --connect-timeout 3 --output $IP.txt http://$IP:631/printers & done; done