IFELSE(1)

NAME
ifelse - perform conditional execution, with two branches

SYNOPSIS
In an execlineb(1) script:

ifelse [-X] [-n] { prog1... } { prog2... } prog3...

DESCRIPTION
ifelse reads prog1... in a block ( cf. execline-block(7)). It forks and executes it, then waits for it to complete.

If prog1 crashes, ifelse prints an error message and exits 128 plus the number of the signal that killed prog1.

If prog1 exits with a return code equal to 0, ifelse exec(3) s into prog2.

Else ifelse exec(3) s into prog3.

‘ifelse prog1... "" prog2... "" prog3...’ is roughly equivalent to ‘sh -c 'prog1... && exec prog2... || exec prog3...'’.

OPTIONS

-n  Negate the test.

-X  Do not die if prog1 crashes; treat a crash as a non-zero ( “false”) exit.

SEE ALSO
background(1), backtick(1), execlineb(1), foreground(1), if(1), ifte(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/ifelse.html

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