News for hackers. Stuff that matters.
Re:A TCP Port Scanner in Bash by kill-9-1 on Tuesday August 28, 2012 @06:14PM (#4446153)
backgrounding a job to sleep/kill a pid isn't necessarily a great idea imho. here, if the port in question is open then then you will pass the wait relatively quickly, but you still have a timer set to kill the pid. A short timer probably won't cause an issue, but the longer you wait the more likely it becomes that the kernel will assign that pid to a new process that you probably don't want killed. especially if you are launching two new pids for each possible port.
Re:A TCP Port Scanner in Bash by icebraining on Tuesday August 28, 2012 @07:02PM (#4446319)
I considered that, but didn't have time to think about a proper solution. Using bash's own job control instead of regular kill would probably be better.