pkill -P $$
will fit (just kills it’s own descendants)
EDIT: I got a downvote, don’t know why. Anyway here is the help of -P
-P, --parent ppid,...
Only match processes whose parent process ID is listed.
and $$
is the process id of the script itself
More Related Contents:
- Quick-and-dirty way to ensure only one instance of a shell script is running at a time
- Quick-and-dirty way to ensure only one instance of a shell script is running at a time
- How does Ctrl-C terminate a child process?
- Bash conditional based on exit code of command
- Forking / Multi-Threaded Processes | Bash
- How to pipe multiple commands into a single command in the shell? (sh, bash, …)
- Using groovy, how do you pipe multiple shell commands?
- How to wait on all child (and grandchild etc) process spawned by a script
- What does `kill -0 $pid` in a shell script do?
- How can I compare numbers in Bash?
- Pipe output and capture exit status in Bash
- Redirect stderr and stdout in Bash [duplicate]
- Why equal to operator does not work if it is surrounded by space?
- Which characters need to be escaped when using Bash?
- “~/Desktop/test.txt: No such file or directory”
- Capturing Groups From a Grep RegEx
- bash : Illegal number
- Shell redirection i/o order
- Colorized grep — viewing the entire file with highlighted matches
- How to pass in password to pg_dump?
- Select random lines from a file
- Variables getting reset after the while read loop that reads from a pipeline
- Hexadecimal To Decimal in Shell Script
- LINES and COLUMNS environmental variables lost in a script
- Get current directory or folder name (without the full path)
- How do file descriptors work?
- When does command substitution spawn more subshells than the same commands in isolation?
- How do I get both STDOUT and STDERR to go to the terminal and a log file?
- Use GNU find to show only the leaf directories
- docker entrypoint running bash script gets “permission denied”