IFTE(1)
ifte(1) β perform a conditional alternative π
okay so bestie, welcome to the ifte page β it's giving "choose your own adventure" but make it Unix β¨
β¨ SYNOPSIS β¨
In an execlineb(1) script:
ifte [-X] [-n] { progthen... } { progelse... } progif...
πΈ DESCRIPTION πΈ
okay so picture this: ifte peeks at progthen... and progelse... sitting in two back-to-back blocks (shoutout to execline-block(7) for that whole situation) π
then it runs progif... as a child process and justβ¦ waits for it to finish. patient queen behavior π
now here's the drama: if progif... crashes (like, gets killed by a signal π), ifte prints an error message and then exits with 128 plus the number of the signal that killed progif. no cap, that's the whole vibe check.
if progif... exits zero? slay, ifte exec(3)s into progthen... π₯
otherwise? it exec(3)s into progelse.... the plot twist we deserved π¦
also important: ifte is literally the simpler version of ifthenelse(1). it only does conditional execution, not the whole instruction sequence thing. it's giving "less is more" energy β¨
and for the record, this:
ifthenelse { progif } { progthen } { progelse } remainder
is the equivalent of:
foreground { ifte { progthen } { progelse } progif } remainder
iykyk π«Ά
π OPTIONS π
-Xβ do not exit ifprogifcrashes. instead, just proceed as if the test had returned false. like, "we move" energy π-nβ negate the test.progthen...will be run iffprogif...exits nonzero. chaotic? maybe. iconic? absolutely π
π SEE ALSO π
background(1), backtick(1), execlineb(1), foreground(1), if(1), ifelse(1), ifthenelse(1), pipeline(1), runblock(1), exec(3), execline-block(7)
this man page is ported from the authoritative documentation at: https://skarnet.org/software/execline/ifte.html β go show it some love π
π AUTHORS π
- Laurent Bercot
- Alexis <flexibeast@gmail.com> (man page port)
okay that's the whole page bestie, go forth and conditionally execute β¨π¦π
β Debian, February 14, 2021, IFTE(1) β 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