FOREGROUND(1)
β¨ NAME β¨
okay so bestie, this is foreground from the General Commands Manual β the foreground(1) page β and it is literally about executing a sequence of commands. π
πΈ SYNOPSIS πΈ
Inside an execlineb(1) script, it's giving:
foreground { prog1... } prog2...
π DESCRIPTION π
foreground reads prog1 in a block (cf. execline-block(7)). It forks and executes it, then waits for it to complete. no cap. π«Ά
Then foreground sets the ? environment variable to the exit code of prog1. If prog1... was killed by a signal, the ? value is 256 plus the signal number. π
After that, foreground exec(3)s into prog2.... slay. π
foreground is the basic sequence operator: it takes two commands and executes them one by one. execline scripts require it to wrap external commands that exit, instead of natively supporting the βperform some action, then execute some other programβ model. β¨
Here's the exact equivalence, bestie:foreground prog1... "" prog2...is equivalent tosh -c 'Ar prog1... ; exec prog2...'. π¦
256 and above are not valid exit codes for commands, so when the ? environment variable contains 256 or more, it means that the previous command was killed by a signal. There is no ambiguity here, and ? reports exactly what happened to the previous command; foreground does not exit, so there is no need for exit code approximation (cf. execline-exitcodes(7)). π
π SEE ALSO π
background(1)backtick(1)execlineb(1)if(1)ifelse(1)ifte(1)ifthenelse(1)pipeline(1)runblock(1)exec(3)execline-block(7)execline-exitcodes(7)
This man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/foreground.html
π AUTHORS π
- Laurent Bercot
- Alexis
<flexibeast@gmail.com>(man page port)
okay that's the whole page, bestie β it's from Debian, dated February 14, 2021. periodt. π
π¦ where this page comes from
- nixpkgs unstable: execline 2.9.9.2
- nixpkgs unstable: execline-man-pages 2.9.9.1.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms