Skip to content

Instantly share code, notes, and snippets.

@treyharris
Last active February 3, 2020 22:46
Show Gist options
  • Save treyharris/b008adf63fa82d5b22ae476a16876632 to your computer and use it in GitHub Desktop.
Save treyharris/b008adf63fa82d5b22ae476a16876632 to your computer and use it in GitHub Desktop.
# moshPids is an array of pids
for p in $moshPids; do
if [[ -n $interactive ]]; then
stty -echo
read -q "answer?Kill $p? (N/y)"
stty echo
echo >&2
[[ "${answer}" == 'n' ]] && continue
fi
# do_kill set to print “killing $1” in debug
do_kill $p
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment