beautypg.com

The following conditions can be used with if – Gasboy CFN III Manager Manual V3.6 User Manual

Page 214

background image

Advanced Command Files

How to Use the IF Command

Page 20-2 MDE-4871 CFN III Manager’s Manual for Windows® XP Embedded - Version 3.6 · August 2010

The following conditions can be used with IF.

Switch

Function

-y

With a -y switch, text is echoed to the data terminal or console, and if the user
enters a 1, Y, or y from the console or data terminal keyboard, the commands
following the IF statement are executed.

• If the user enters a 0, N, or n, the commands following the IF statement are

skipped, and, if an ELSE follows, the commands following ELSE are
executed.

• If the user enters anything else, the text is printed again.

-!y

A -!y switch is similar to a -y switch, but works in reverse. Text is echoed to the
data terminal or console, and if the user enters a 1, Y, or y from the console or
data terminal keyboard, the commands following the IF statement are skipped.

• If an ELSE follows, the commands following ELSE are executed.
• If the user enters a 0, N, or n, the commands following the IF statement are

executed. If the user enters anything else, the text is printed again.

arg1=arg2

With a = switch, the next two arguments are compared for literal equality.

• If they are equal, the commands following the IF statement are executed.
• If the arguments are not equal, the IF commands are skipped, and, if an

ELSE follows, the commands following ELSE are executed.

arg1!=arg2

The != switch is similar to the = switch, but works in reverse.

• If the next two arguments are equal, the commands following the IF

statement are skipped, and, if an ELSE follows, the commands following
ELSE are executed.

• If the arguments are not equal, the commands following the IF statement are

executed.

arg1

With the < switch, the next two arguments must be numbers.

• If the first argument is less than the second argument, the commands

following the IF statement are executed.

• If the first argument is not less than the second argument, the IF commands

are skipped, and if an ELSE follows, the commands following the ELSE are
executed.

arg1<=arg2

With the <= switch, the next two arguments must be numbers.

• If the first argument is less than or equal to the second argument, the

commands following the IF statement are executed.

• If the first argument is not less than or equal to the second argument, the IF

commands are skipped, and if an ELSE follows, the commands following the
ELSE are executed.

arg1>arg2

With the > switch, the next two arguments must be numbers.

• If the first argument is greater than the second argument, the commands

following the IF statement are executed.

• f the first argument is not greater than the second argument, the IF

commands are skipped, and if an ELSE follows, the commands following the
ELSE are executed.

arg1>=arg2

With the >= switch, the next two arguments must be numbers.

• If the first argument is greater than or equal to the second argument, the

commands following the IF statement are executed.

• f the first argument is not greater than or equal to the second argument, the

IF commands are skipped, and if an ELSE follows, the commands following
the ELSE are executed.

-e filename

With the -e switch the next argument is treated as a file name.

• If the file exists, the commands following the IF statement are executed.
• If it does not exist, the commands following the IF statement are skipped,

and, if an ELSE follows, the commands following ELSE are executed.
(Unless the command is executed upon a file in the current directory,
filename must include the path.)

This manual is related to the following products: