A2osX/EXAMPLES/ANDORTESTS.txt

110 lines
2.7 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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