BACKGROUND(1)

πŸ“¦ version 2.9.9.2, in nixpkgs unstable

πŸ’… BACKGROUND(1) πŸ’…

okay so real talk, this is the background page from the General Commands Manual β€” section 1, commands, the classics β€” and bestie, it's about to make your whole execline era make sense ✨


πŸŽ€ NAME πŸŽ€

background β€” launch a command in the background, then go on with the execution flow πŸ¦‹

like, you fire something off into the void and just keep going, no waiting, no blocking, no "hello?? are you done yet??" energy. periodt.


✨ SYNOPSIS ✨

inside an execlineb(1) script, it's giving:

background [-d] { prog1... } prog2...

yes, those curly braces are load-bearing, we'll get to that πŸ’–


🌸 DESCRIPTION 🌸

so here's the whole vibe, step by step:

background reads a prog1... command out of an execline-block(7) and unquotes it πŸ”₯

then it spawns a child executing prog1.... that child is off doing its own thing now, living its own life, main character energy fr.

then β€” and this is the iconic part β€” it sets the ! environment variable to the pid of the prog1... process πŸ‘‘ so if you ever need to know which process you just yeeted into the background, the answer is literally sitting right there in !.

and then it exec(3)s into prog2.... like, it doesn't stick around, it becomes prog2.... slay.

so this command:

background prog1... "" prog2...

is equivalent to:

sh -c 'prog1... & ; exec prog2...'

same energy, different font πŸ’…


🫢 OPTIONS 🫢

  • -d β€” Doublefork. if the -d option is set, prog1... will run as a grandchild of background 😭 (yes, grandchild β€” the family tree gets one level deeper, no cap)

πŸ¦‹ SEE ALSO πŸ¦‹

backtick(1), foreground(1), if(1), ifelse(1), ifte(1), ifthenelse(1), pipeline(1), runblock(1), execline-block(7)

go read those too, they're all lowkey essential, iykyk πŸ’œ

this man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/background.html β€” the source of truth, the blueprint, the origin story 🌈


🌟 AUTHORS 🌟

  • Laurent Bercot
  • Alexis <flexibeast@gmail.com> (man page port)

and that's the whole page bestie πŸ“ now go background something and forget about it, that's the entire point πŸ’€

β€” Debian, February 14, 2021, BACKGROUND(1) β€” written with love, shipped with background πŸ’–πŸ§šβ­

πŸ“¦ where this page comes from