Timeline for What does bash do in the background once it runs a program?
Current License: CC BY-SA 4.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 14, 2019 at 5:19 | comment | added | dave_thompson_085 | A process run asynchronously (with &) is NOT redirected to /dev/null; it still has the tty open, but it is in a different process group so trying to read (and optionally write) the tty causes it to be suspended; you can use the shell fg command to give that pgrp (aka 'job') access and it can then use the tty just fine (unless you ^Z which takes the tty away again, back to the shell). See (long!) unix.stackexchange.com/a/509566/59699 | |
| Nov 13, 2019 at 22:28 | comment | added | Kusalananda♦ | @ilkkachu Not important, but it's waiting with either wait3() or waitpid() depending on Unix (the WAITPID macro in job.c). | |
| Nov 13, 2019 at 22:13 | comment | added | ilkkachu | Window managers are an X thing, replace that with "the terminal" and this sounds about right to me. The sleep the shell goes to is the wait() system call (or one of the dozen or so variants of it). | |
| Nov 13, 2019 at 21:34 | history | answered | Paul_Pedant | CC BY-SA 4.0 |