Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

10.0;if, revision 1.0, 88/01/21
if -- Execute a conditional statement.
usage: if condition then command_1  [else command_2...] endif



DESCRIPTION
     if executes a conditional statement depending on the results of a Boolean
     test.  You can extend the if command  over several lines if you use it
     interactively or in a shell script.  When you use if interactively, and
     extend the command over more than one line, the shell prompts you for
     each new line of the command with the $_ prompt (refer to the example
     below).

ARGUMENTS
     condition (required)
                     Specify a command or program to execute and test for
                     truth, or specify a variable expression or Boolean
                     variable to test for truth.  "Truth" usually means that
                     the command executes successfully (without any errors),
                     or that the shell variable expression or Boolean is
                     "true". (Specifically, this argument is evaluated true if
                     it returns an abort-severity level of 0 (zero).)

                     Refer to the manual, Using Your Aegis Environment for
                     more information on shell variables.

     command_1 (required)
                     Specify command or program to execute if condition
                     returns true.

     command_2 (optional)
                     Specify command or program to execute if condition
                     returns false (that is, a severity level greater than
                     zero).

EXAMPLES
     1.

        $ if eqs a a
        $_ then args "a is a"
        $_ else args "Aristotle was wrong."
        $_ endif
        a is a
        $


     2.

        if eqs ^2 '-c'
        then pas ^1
             bind ^1.bin library -b ^1
        else bind ^1.bin library -b ^1
        endif

        Example 2 might appear in a shell script.  These lines compile the
        Pascal module named by the first argument ^1 if the second argument ^2
        is -c.  Then it binds the module with library.  If the second argument
        is not -c, or if there is no second argument, the command simply binds
        the module.


SEE ALSO
     More information is available.  Type

     help  abtsev   For information about abort-severity levels

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026