Hi, I am trying to get nmap to be a bit more "friendly" by wrapping it inside a perl script that will cause it to spit out a status by "sending it a character": == #!/usr/bin/perl use IPC::Open3; use POSIX ":sys_wait_h"; use FileHandle;
$| = 1; my $nmap = "/usr/bin/nmap"; my @ips = ('192.168.1.*'); my $cmdline = " $nmap $args -v -v -v -sT -p 1-65535 -oX - ".(join ' ',@ips); print "cmdline: $cmdline\n"; my ($readfh, $writefh, $errorfh) = (FileHandle->new(), FileHandle->new(), FileHandle->new()); my $pid = 0; $pid = open3($writefh, $readfh, $errorfh, $cmdline) || die "Can't open pipe to $cmdline: $!\n"; while(<$readfh>) { print $_; print $writefh "A"; } print STDERR "done\n"; == nmap will give out a progress if keyWasPressed is detected the code for this is found inside nmap_tty.cc which basically does: if ((c = tty_getchar()) >= 0) { For some reason the above code doesn't do it, is it because its not being sent via tty? if so is there a way to fool it? _______________________________________________ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il