How to do same as 'nmap' command from within a D program?
forkit
forkit at gmail.com
Sat Jan 22 22:44:31 UTC 2022
On Saturday, 22 January 2022 at 20:55:38 UTC, Daren Scot Wilson
wrote:
>
is this helpful:
// ---
module test;
import std;
void main()
{
auto result = execute(["bash", "-c", "nmap -sn
192.168.11.0/24 | ack -B2 \"Phillips\""]);
if(canFind(result.to!string, "Host is up"))
writeln("Host is up");
else
writeln("Host not found.");
}
// ---
More information about the Digitalmars-d-learn
mailing list