Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# james shubin, agplv3+
# pause until key press and then continue
if [ ! "$#" -eq 1 ]; then
echo "Usage: `basename $0` <process>"
echo "Pauses process until key press and then continues!"
exit 1
echo "Stopping '$1'..."
killall -SIGSTOP "$1"
if [ $e -ne 0 ]; then
echo "Could not pause '$1', error '$e'."
exit $e
echo "[press any key to continue]"
#read -n1 -r -s -p "[press any key to continue]" key
read -n1 -r -s key
tput cuu 1 && tput el # remove last line
echo "Continuing '$1'..."
#echo # newline
killall -SIGCONT "$1"
exit $?

This comment has been minimized.

Copy link

joejulian commented Jan 6, 2017

imho, you should use the procps pkill rather than killall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.