home *** CD-ROM | disk | FTP | other *** search
-
-
-
- IF(V1.3) ARP User's Manual IF(V1.3)
-
-
-
- NAME
- IF - Add intelligent branching to scripts.
-
- SYNOPSIS
- IF NOT/s WARN/s ERROR/s FAIL/s EQ/k GT/k GE/k VAL/s EXISTS/k
-
- DESCRIPTION
- If the condition tested by IF evaluates to TRUE, then the
- commands immediately following the IF, up to the following
- ELSE or ENDIF, are executed. If the condition tested by IF
- evaluates to FALSE, it moves the execution of the file ahead
- to the command following the next ELSE command (if there is
- one), or to ENDIF, if there is no intervening ELSE.
-
- CONDITIONS
- Each of the following will evaluate to true or false:
-
- WARN This will be true if the return code value set by the
- last command is greater than or equal to 5.
-
- ERROR
- This will be true if the return code value set by the
- last command is greater than or equal to 10.
-
- FAIL This will be true if the return code value set by the
- last command is greater than or equal to 20. Note that
- you will have to use a Failat command to raise the
- default fail limit from 10 to above 20 if you wish to
- use this test.
-
- EQ This takes two arguments, and will be true if both
- arguments are the same (i.e., EQUAL). The default is a
- string comparison, but see VAL, below.
-
- GE Takes two arguments. This will be true if the first
- argument is Greater than or Equal to the second
- argument. This may be combined with NOT (see below) to
- perform a LT (less than) test. The default comparison
- is a string compare, but see VAL, below.
-
- GT Takes two arguments. This will be true if the first
- argument is Greater than the second. This may be
- combined with NOT (see below) to construct a LE (less
- than or equal to) test. The default comparison is a
- string compare, but see VAL, below.
-
- EXISTS
- This takes one argument, which should be a device, file
- or directory. This will be TRUE if the device, file or
- directory exists.
-
- MODIFIERS
-
-
-
- Page 1 (printed 4/28/89)
-
-
-
-
-
-
- IF(V1.3) ARP User's Manual IF(V1.3)
-
-
-
- The following options to IF modify the meaning of the above
- tests:
-
- NOT Inverts the sense of the test. This is always used in
- combination with another keyword. As an example, the
- line: "If NOT EQ" will be TRUE if the EQ is false. This
- modifier combines with any of the others.
-
- VAL This affects the type of compare done by the EQ GT and
- GE keywords. By default, the comparison is a string
- compare. However, if you specify this keyword, the
- comparison performed is numeric.
-
- OTHER
- The ARP Shell contains this command as a builtin, the only
- difference between the two is that the Shell version can be
- executed directly from the command line, while the diskbased
- version cannot.
-
- Both versions support environment variable expansion. The
- shell always expands environment variables, and the
- diskbased version does it internally.
-
- EXAMPLE
- IF EXISTS ARP_DISK
- Echo "An excellent decision!"
- ELSE
- Echo "Why not?"
- ENDIF
-
- SEE ALSO
- AshManual Execute
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Page 2 (printed 4/28/89)
-
-
-
-