A2osX/EXAMPLES/ANDORDEMO.txt

110 lines
2.7 KiB
Plaintext
Raw Permalink Normal View History

NEW
PREFIX
AUTO 4,1
#!/BIN/SH
#
# Complex AND OR Tests
#
SET A = 1
SET B = 2
SET C = 3
SET D = 4
ECHO -N "TRUE AND TRUE OR TRUE AND TRUE ---> "
IF [ $A -eq 1 ] AND [ $B -eq 2 ] OR [ $C -eq 3 ] AND [ $D -eq 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "TRUE AND TRUE OR TRUE AND FALSE ---> "
IF [ $A -eq 1 ] AND [ $B -eq 2 ] OR [ $C -eq 3 ] AND [ $D -ne 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "TRUE AND TRUE OR FALSE AND TRUE ---> "
IF [ $A -eq 1 ] AND [ $B -eq 2 ] OR [ $C -ne 3 ] AND [ $D -eq 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "TRUE AND TRUE OR FALSE AND FALSE ---> "
IF [ $A -eq 1 ] AND [ $B -eq 2 ] OR [ $C -ne 3 ] AND [ $D -ne 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "TRUE AND FALSE OR TRUE AND TRUE ---> "
IF [ $A -eq 1 ] AND [ $B -ne 2 ] OR [ $C -eq 3 ] AND [ $D -eq 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "TRUE AND FALSE OR TRUE AND FALSE ---> "
IF [ $A -eq 1 ] AND [ $B -ne 2 ] OR [ $C -eq 3 ] AND [ $D -ne 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "TRUE AND FALSE OR FALSE AND TRUE ---> "
IF [ $A -eq 1 ] AND [ $B -ne 2 ] OR [ $C -ne 3 ] AND [ $D -eq 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "TRUE AND FALSE OR FALSE AND FALSE ---> "
IF [ $A -eq 1 ] AND [ $B -ne 2 ] OR [ $C -ne 3 ] AND [ $D -ne 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "FALSE AND TRUE OR TRUE AND TRUE ---> "
IF [ $A -ne 1 ] AND [ $B -eq 2 ] OR [ $C -eq 3 ] AND [ $D -eq 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "FALSE AND TRUE OR TRUE AND FALSE ---> "
IF [ $A -ne 1 ] AND [ $B -eq 2 ] OR [ $C -eq 3 ] AND [ $D -ne 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "FALSE AND TRUE OR FALSE AND TRUE ---> "
IF [ $A -ne 1 ] AND [ $B -eq 2 ] OR [ $C -ne 3 ] AND [ $D -eq 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "FALSE AND TRUE OR FALSE AND FALSE ---> "
IF [ $A -ne 1 ] AND [ $B -eq 2 ] OR [ $C -ne 3 ] AND [ $D -ne 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "FALSE AND FALSE OR TRUE AND TRUE ---> "
IF [ $A -ne 1 ] AND [ $B -ne 2 ] OR [ $C -eq 3 ] AND [ $D -eq 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "FALSE AND FALSE OR TRUE AND FALSE ---> "
IF [ $A -ne 1 ] AND [ $B -ne 2 ] OR [ $C -eq 3 ] AND [ $D -ne 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "FALSE AND FALSE OR FALSE AND TRUE ---> "
IF [ $A -ne 1 ] AND [ $B -ne 2 ] OR [ $C -ne 3 ] AND [ $D -eq 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
ECHO -N "FALSE AND FALSE OR FALSE AND FALSE ---> "
IF [ $A -ne 1 ] AND [ $B -ne 2 ] OR [ $C -ne 3 ] AND [ $D -ne 4 ]
ECHO TRUE
ELSE
ECHO FALSE
FI
MAN
TEXT /MAKE/USR/SHARE/EXAMPLES/ANDORTESTS