Reputation: 2151
What is this shell command doing?
trap 'sudo kill -9 -- -$$' EXIT
Upvotes: 9
Views: 826
Reputation: 1
$$
is the process ID of the script itself-$$
means use the process group ID--
signals the end of optionsSo upon exit the trap
will kill all subprocesses of the script.
Upvotes: 6