I have script as below
testscript.sh
#!/bin/bash
while true
do
/sbin/tcpdump -n -c 2 -i eth0 >/tmp/pkt_eth0
sleep 60
done
When I try to kill it testscript.sh
vanish but tcpdump
waiting process still there. Also for testscript.sh
I am not able to use killall
so need pid
$kill -15 pid
but would prefer
$killall -15 testscript.sh
to end script and all child processes. How it can be achieved?