I have a very simple unix bash script. I use it to execute a command every second. It has the following form:
while : ; do
cat /proc/`pidof iBrowser.bin`/smaps | awk -f ./myawkscript.awk >> $DIRPATH
sleep 1
done
The script is working fine, but it will not stop! If I press ctrl-C while the script is running, the process will not stop, and I get the following error:
cat: cannot open '/ proc // smaps': no such file or directory
Does anyone know how to avoid this?
source
share