我完全不了解bash脚本,我正试图让这个工作:
扫描ip范围,查找端口80打开的设备…
我认为它必须如下所示:
#!/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
我也只是想看到这样的结果:
----------------------------------- 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 -----------------------------------
有人可以帮我吗?
谢谢