Hi I have used the following script, which after it has run and exited, causes my command line to display no text when typing, and after each carriage return instead of starting a new line like
root@alix:~#
root@alix:~#
I get
root@alix:~# root@alix:~# root@alix:~# root@alix:~# etc
When using ctrl c I get
root@alix:~#
root@alix:~#
root@alix:~# etc
Here is the script:
#!/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
if [ $count_secs -gt 0 ]
then
###
### number of seconds greater than zero
###
watch -n 0.5 'iw dev wlan0 station dump | grep "signal avg" >> processmonitor.log' >>/dev/null &
###
### assume that the PID of the command is $$
###
my_PID=$!
sleep $count_secs
kill -15 $my_PID
fi
Thanks.
watch