if you're familiar with nmap then you might know that while it's running you can hit the enter key and it will return the status.

That is not always true. It depends on 3 factors 1) the system it's being run on, 2) the version of nmap and 3) the version of pcap.

What you want to do can't be done via the system function because it simply forks a child process and blocks the parent until the command completes and then returns the exit code to the parent. What you want to achieve might be possible via Expect, but I've never bothered to test it.

if you're familiar with nmap then you might know that while it's running you can hit the enter key and it will return the status.

That is not always true. It depends on 3 factors 1) the system it's being run on, 2) the version of nmap and 3) the version of pcap.

What you want to do can't be done via the system function because it simply forks a child process and blocks the parent until the command completes and then returns the exit code to the parent. What you want to achieve might be possible via Expect, but I've never bothered to test it.