Type in a command, or "ls dictionary" to search all commands for "dictionary", etc.

iff

ifthen -value1 ${lt}${gt}${le}${ge}${eq}${ne} -value2 -test EQUAL -then {ifthen -value1 %s -value2 False -test EQUAL -then ${else} -else {ifthen -value1 %s -value2 No -test EQUAL -then ${else} -else {ifthen -value1 %s -value2 0 -test EQUAL -then ${else} -else {ifthen -value1 %s -value2 -test EQUAL -then ${else} -else ${then} -redirect ${follow}} -redirect ${follow}} -redirect ${follow}} -redirect ${follow}} -else {ifthen -value1 %s -value2 ${lt}${gt}${le}${ge}${eq}${ne} -test {ifthen -value1 -value2 ${eq} -test EQUAL -then {ifthen -value1 -value2 ${gt} -test EQUAL -then {ifthen -value1 -value2 ${lt} -test EQUAL -then {ifthen -value1 -value2 ${ge} -test EQUAL -then {ifthen -value1 -value2 ${le} -test EQUAL -then NOTEQUAL -else LESSEQUAL} -else GREATEREQUAL} -else LESS} -else GREATER} -else EQUAL} -then ${then} -else ${else} -redirect ${follow}}
NAME
    iff - compare two values and return a value based on the result.

SYNOPSIS
    iff <value1> [-lt|gt|le|ge|eq|ne <value2>] [-then <result1>] [-else <result2>] [-follow True|False]

EXAMPLES
    iff 1 -lt 2 -then yes -else no
        (returns "yes" since "1" is less than "2")
    iff -eq ${var} -then yes -else no
        (returns "yes" if var is empty, "no" otherwise)
    iff True -then yes -else no
        (returns "yes")
    iff False -then yes -else no
        (returns "no")
    iff abc -eq bcd -then http://google.com -else http://yahoo.com -follow True
        (returns the Yahoo! webpage)

DESCRIPTION
    Either compares two values, or checks for the truth of a value.
    All values other than "False", "No", "0" and "" are interpreted
    as True.

    Permitted comparisons are:
        -lt       (Less Than)
        -gt       (Greater Than)
        -le       (Less than or Equal)
        -ge       (Greater than or Equal)
        -eq       (EQual)
        -ne       (Not Equal)

    When checking if a variable is empty, the variable has to
    be specified behind the comparison switch:
        iff -eq ${var} -then yes -else no
    The following WILL NOT work:
        iff ${var} -eq -then yes -else no

    If the -follow switch is set to "True", iff tries to follow links
    that begin with "http://". The default setting for -follow is "False".

AUTHOR
    Samuel Hoffstaetter "http://shoffsta.linuxside.org/"
    based on "IfThen" by Allen Ormond <aormond (at) fromrocks (dot) com>

    
473 uses - Created 2006-01-06 10:38:55 - Last used 2013-05-16 13:12:20
Is this command broken? Tell Jon if you know how to fix it.
Do you find this command offensive? Let Jon know.