Celeb Glow
news | March 30, 2026

Send multiple kill signals to a process

Say I run a .sh process. And now I open a new terminal tab and I want to send signals to it, for that, I just use kill:

kill -*signal number* *pid*

right? But I want to send 13 signals at the same time, how can I do that?

2

1 Answer

You cannot send 13 signals at once but must loop over some list of signals. The following script will do so:

#!/usr/bin/env bash
pid=${1-""}
if [ -z "$pid" ]; then echo "a pid must be given"; exit 1;
fi
siglist=( SIGSTOP SIGCONT SIGSTOP SIGCONT SIGSTOP SIGCONT SIGSTOP SIGCONT SIGSTOP SIGCONT SIGSTOP SIGCONT SIGTERM
)
for sig in "${siglist[@]}"; do kill -$sig $pid;
done
exit 0;

Save the script as send-sigs.sh, apply chmod +x send-sigs.sh and then call it like so:

./send-sigs.sh 1234

I used the signals STOP and CONT to alternately freeze and thaw the given pid but you can use different signals to your liking. But be aware that some signals might stop your target process so it won't receive any signals afterwards.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy