works on command line but not in bash script
Hi
(lets say i want to kill the kwrite application) if i run the following on the command line: kill -s SIGINT `ps -C kwrite -o pid h` but if i put that exact line in a script i get the following error: kill: SIGINT: invalid signal specification and the command doesn't work do anyone know why or how to fix. thanks Tara p.s. using #!/bin/sh |
SIGINT is interrupt from keyboard
That can be one reason why it is not working non-interactively. |
thanks zulfilee
is there any way to send keyboard signals from a script, i don't really want to kill the process using the kill command directly hence why trying SIGINT. SIGINT provides a clean way of shutting down the other related processes. Tara |
Quote:
The problem is that you don't need the SIG, just use kill -s INT ... |
killall -TERM kwrite
if it has been blocked by the application, then killall -KILL kwrite |
thanks guys
both ways worked perfectly :) cheers Tara |
Sending SIGUSR1
Quote:
system("kill -SIGUSR1 'cat /var/run/process.pid'"); but facing the same problem i.e. i am getting error invalid signal specification But from konsole if I try to send then does not give any problem.. Can you please help whats wrong with this?? |
Quote:
kill(int pid, int signal); |
All times are GMT -5. The time now is 06:32 PM. |