Friday, 15 February 2013

linux - shell script terminating program but not the script itself -



linux - shell script terminating program but not the script itself -

i using shell script automatically search network access points, , in airodump utilize ctrl + c stop search, , wanting cancel search maintain shell script running. since wanting user input after done searching wifi networks. tried utilize trap, , stops airodump, , script.

i wanting stop airodump wifi search , move onto shell script of user input.

it's not exclusively clear me, believe wanting user able interactively stop search via ctrl-c , prompted input. should that:

#!/bin/sh trap 'test "$airo" && kill -2 $airo' 2 airodump ... & airo=$! wait unset airo # commands here execute after user hits ctrl-c terminate search

linux shell trap

No comments:

Post a Comment