Você pode usar o seguinte código sem a necessidade de matar qualquer processo, após o término do tempo especificado (segs) ele irá sair.
#!/bin/bash
###
### Run command for given number of seconds then kill it
###
read -p "How long should I run for? ==> " count_secs
echo "Time specified: " $count_secs
# $SECONDS is a shell variable
# we can use it in conjuction with
# our user input
while [ "$SECONDS" -le "$count_secs" ]
do
# execute any commands here (put your code bellow and remove echo commands)
echo 'date +%r'
echo "i am doing my work now"
# sleep (in secs) before the next execution
sleep 1
done
# when the count_secs elapses exit
exit 0