2019-02-22 03:47:12 +00:00
|
|
|
|
NEW
|
|
|
|
|
PREFIX
|
|
|
|
|
AUTO 4,1
|
|
|
|
|
#!/BIN/SH
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
#
|
2019-02-26 20:48:30 +00:00
|
|
|
|
ECHO "\f If Numeric Tests"
|
|
|
|
|
ECHO "\nThis Performs Several Numeric Comparison Tests"
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N "\n Test 1: 99 = 99 "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ 99 -eq 99 ]
|
|
|
|
|
echo True Pass
|
|
|
|
|
ELSE
|
|
|
|
|
echo False Fail
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 2: 99 = 79 "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ 99 -eq 79 ]
|
|
|
|
|
echo True Fail
|
|
|
|
|
ELSE
|
|
|
|
|
echo False Pass
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 3: 99 <> 99 "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ 99 -NE 99 ]
|
|
|
|
|
echo True Fail
|
|
|
|
|
ELSE
|
|
|
|
|
echo False Pass
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 4: 99 <> 79 "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ 99 -NE 79 ]
|
|
|
|
|
echo True Pass
|
|
|
|
|
ELSE
|
|
|
|
|
echo False Fail
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 5: 99 < 79 "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ 99 -LT 79 ]
|
|
|
|
|
ECHO True Fail
|
|
|
|
|
ELSE
|
|
|
|
|
ECHO False Pass
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 6: 79 < 99 "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ 79 -LT 99 ]
|
|
|
|
|
ECHO True Pass
|
|
|
|
|
ELSE
|
|
|
|
|
ECHO False Fail
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 7: 99 <= 79 "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ 99 -LE 79 ]
|
|
|
|
|
ECHO True Fail
|
|
|
|
|
ELSE
|
|
|
|
|
ECHO False Pass
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 8: 79 <= 99 "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ 79 -LE 99 ]
|
|
|
|
|
ECHO True Pass
|
|
|
|
|
ELSE
|
|
|
|
|
ECHO False Fail
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 9: 99 <= 99 "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ 99 -LE 99 ]
|
|
|
|
|
ECHO True Pass
|
|
|
|
|
ELSE
|
|
|
|
|
ECHO False Fail
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 10: 99 > 79 "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ 99 -GT 79 ]
|
|
|
|
|
ECHO True Pass
|
|
|
|
|
ELSE
|
|
|
|
|
ECHO False Fail
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 11: 79 > 99 "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ 79 -GT 99 ]
|
|
|
|
|
ECHO True Fail
|
|
|
|
|
ELSE
|
|
|
|
|
ECHO False Pass
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 12: 99 => 79 "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ 99 -GE 79 ]
|
|
|
|
|
ECHO True Pass
|
|
|
|
|
ELSE
|
|
|
|
|
ECHO False Fail
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 13: 79 => 99 "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ 79 -GE 99 ]
|
|
|
|
|
ECHO True Fail
|
|
|
|
|
ELSE
|
|
|
|
|
ECHO False Pass
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 14: 99 => 99 "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ 99 -GE 99 ]
|
|
|
|
|
ECHO True Pass
|
|
|
|
|
ELSE
|
|
|
|
|
ECHO False Fail
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO "\n End of Test\n"
|
|
|
|
|
MAN
|
|
|
|
|
TEXT /MAKE/USR/SHARE/TESTS/IFNUMTEST
|