IFTHENELSE(1)
πΈ NAME πΈ
The General Commands Manual page IFTHENELSE(1) is all about ifthenelse(1) β perform a conditional alternative, bestie!! π
Itβs the βpick a pathβ girlie of execline, and yes, she ate. β¨
π¦ SYNOPSIS π¦
In an execlineb(1) script:
ifthenelse [-X] [-s] { progif... } { progthen... } { progelse... }
prog...
β¨ DESCRIPTION β¨
Okay so ifthenelse reads progif..., progthen..., and progelse... in 3 consecutive blocks (cf. execline-block(7)). Three blocks, three vibes, one conditional. π
First up: it runs progif... as a child process and waits for it to complete. Like, actually waits. π
If progif... crashes β i.e. itβs killed by a signal β ifthenelse prints an error message, then exits 128 plus the number of the signal that killed progif. Thatβs the dramatic part, and yes, it means exactly what it says. π
If progif... exits zero, ifthenelse runs progthen... as a child process; else it runs progelse.... Simple as that, no cap. π
Then ifthenelse waits for its child to complete and puts the exit status in the ? environment variable. After that, it exec(3)s into prog.... Bye bestie, itβs prog...βs turn now. π«Ά
π OPTIONS π
-Xβ ifprogifcrashes, do not exit; proceed as if it had returned false. π-sβ magic scoping hack. This option does powerful but ugly things, and is left undocumented on purpose. So obviously weβre not gonna spill the tea; itβs on purpose. π
π SEE ALSO π
background(1), backtick(1), foreground(1), if(1), ifelse(1), ifte(1), pipeline(1), runblock(1)
This man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/ifthenelse.html β¨
π AUTHORS π
Laurent Bercot Alexis <flexibeast@gmail.com> (man page port)
And thatβs the whole page, bestie!! π This iconic page was brought to you by Debian, dated February 14, 2021 β mwah, kisses, happy scripting!! π
π¦ 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