I'm trying to run nmap from a Bash script, in a way so that when Enter is pressed it should give some output, as happens when running directly from the commandline.
When calling a few different nmap
scans from a Bash script, pressing Enter will not show the time remaining as it would if I ran it directly from the command line.
An example line from my script:
nmap -T4 -iL input.txt -PN -sS -oA tcp_top_1000
Running nmap
like this via the command line, and then hitting Enter results in this type of output:
$ nmap -T4 -iL input.txt -PN -sS -oA tcp_top_1000
Starting Nmap 5.21 ( http://nmap.org ) at 2013-10-18 01:21 EDT
Stats: 0:00:01 elapsed; 0 hosts completed (0 up), 1 undergoing ARP Ping Scan
Parallel DNS resolution of 1 host. Timing: About 0.00% done
Stats: 0:00:01 elapsed; 0 hosts completed (0 up), 1 undergoing ARP Ping Scan
Parallel DNS resolution of 1 host. Timing: About 0.00% done
Stats: 0:00:02 elapsed; 0 hosts completed (0 up), 1 undergoing ARP Ping Scan
Parallel DNS resolution of 1 host. Timing: About 0.00% done
However running that same nmap
command in a shell script inhibits it's ability to do the above.
Is there any way to solve this?
-i
option in she-bang. It may help you.