title: How to determine which IPs in a given range have port 80 using nmap?
body: <p>I'm new to bash scripting and I'm trying to get this working:</p>
  
  <p>Scanning an IP range for finding devices with the port 80 open...
  I think it has to look like this:</p>
  
  <pre><code>#!/bin/bash
  echo -----------------------------------
  for ip in 192.168.0.{1,.255}; do
  nmap -p80 192.168.0.1
        if #open; then
              echo "{ip} has the port 80 open"
        else
              #do nothing
  fi
  done
  echo -----------------------------------
  exit 0
  </code></pre>
  
  <p>I also just want to see the results like this:</p>
  
  <pre><code>-----------------------------------
  192.168.0.1 has the port 80 open
  192.168.0.10 has the port 80 open
  192.168.0.13 has the port 80 open
  192.168.0.15 has the port 80 open
  -----------------------------------
  </code></pre>
  
  <p>(So without errors or <code>nmap</code>'s normal outputs..)</p>
  
  <p>Can someone help me for this?</p>