Skip to main content
5 events
when toggle format what by license comment
Mar 28, 2018 at 21:31 comment added Hauke Laging @jstaab The shell exec command executes an execve() syscall which replaces the running process with a new one. That is the way any process creates a child process: first fork, then the "copy process" does an execve() to the desired binary. The other point: Each background pipeline creates a new process group. Thus you can kill all process which belong to it (and only those) by signaling the whole process group.
Mar 28, 2018 at 19:57 comment added jstaab Interesting, ok. I read up on exec and it looks like it replaces the shell. So in a subshell created with & it kills its parent and steals its pid? That negative pid behavior seems completely bizarre to me, but that's really useful behavior. I'll take it.
Mar 28, 2018 at 3:21 vote accept jstaab
Mar 26, 2018 at 23:01 history edited Hauke Laging CC BY-SA 3.0
added 175 characters in body
Mar 26, 2018 at 22:49 history answered Hauke Laging CC BY-SA 3.0