IFTE(1) BSD General Commands Manual IFTE(1)
NAME
ifte — perform a conditional alternative
SYNOPSIS
In an execlineb(1) script:
ifte [−X] [−n] { progthen... } { progelse... } progif...
DESCRIPTION
ifte reads progthen... and progelse... in two consecutive blocks (
cf. execline-block(7) ).
ifte runs progif... as a child process and waits for it to complete.
If progif... crashes (i.e. is killed by a signal), ifte prints an error message, then exits 128 plus the number of the signal that killed progif.
If progif... exits zero, ifte exec(3)s into progthen..., else it exec(3)s into progelse....
ifte is a simpler version of ifthenelse(1). It performs only conditional execution, not instruction sequence.
‘ifthenelse { progif } { progthen } { progelse } remainder’ is the equivalent of ‘foreground { ifte { progthen } { progelse } progif } remainder’.
OPTIONS
−X
Do not exit if progif crashes; instead, proceed as if the test had returned false.
−n
Negate the test. progthen... will be run iff progif... exits nonzero.
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
AUTHORS
Laurent Bercot
Alexis <
[email protected] > (man page port)
BSD February 14, 2021 BSD