2019-02-21 21:19:56 +00:00
|
|
|
|
NEW
|
|
|
|
|
PREFIX
|
|
|
|
|
AUTO 4,1
|
|
|
|
|
#!/BIN/SH
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
#!/BIN/SH
|
2019-03-01 18:19:14 +00:00
|
|
|
|
ECHO "\f IF String Tests"
|
|
|
|
|
ECHO "\nThis Performs Several String Comparison Tests\n"
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 1 ABC = ABC : "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ "ABC" = "ABC" ]
|
2019-02-22 03:47:12 +00:00
|
|
|
|
echo PASSED
|
2019-01-16 04:50:18 +00:00
|
|
|
|
ELSE
|
2019-02-22 03:47:12 +00:00
|
|
|
|
echo FAILED
|
2019-01-16 04:50:18 +00:00
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 2 ABC not DEF : "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ "ABC" != "DEF" ]
|
2019-02-22 03:47:12 +00:00
|
|
|
|
echo PASSED
|
2019-01-16 04:50:18 +00:00
|
|
|
|
ELSE
|
2019-02-22 03:47:12 +00:00
|
|
|
|
echo FAILED
|
2019-01-16 04:50:18 +00:00
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 3 ABC = ABCD : "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ "ABC" = "ABCD" ]
|
2019-02-22 03:47:12 +00:00
|
|
|
|
echo FAILED
|
2019-01-16 04:50:18 +00:00
|
|
|
|
ELSE
|
2019-02-22 03:47:12 +00:00
|
|
|
|
echo PASSED
|
2019-01-16 04:50:18 +00:00
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO -N " Test 4 ABC not ABC : "
|
2019-01-16 04:50:18 +00:00
|
|
|
|
IF [ "ABC" != "ABC" ]
|
2019-02-22 03:47:12 +00:00
|
|
|
|
echo FAILED
|
2019-01-16 04:50:18 +00:00
|
|
|
|
ELSE
|
2019-02-22 03:47:12 +00:00
|
|
|
|
echo PASSED
|
2019-01-16 04:50:18 +00:00
|
|
|
|
FI
|
2019-03-01 18:19:14 +00:00
|
|
|
|
ECHO -N " Test 5 -N Bad Var : "
|
|
|
|
|
IF [ -N $ABC ]
|
2019-03-01 01:42:33 +00:00
|
|
|
|
echo FAILED
|
|
|
|
|
ELSE
|
|
|
|
|
echo PASSED
|
|
|
|
|
FI
|
2019-03-01 18:19:14 +00:00
|
|
|
|
ECHO -N " Test 6 -Z Bad Var : "
|
|
|
|
|
IF [ -Z $ABC ]
|
|
|
|
|
echo PASSED
|
|
|
|
|
ELSE
|
|
|
|
|
echo FAILED
|
|
|
|
|
FI
|
2019-02-22 03:47:12 +00:00
|
|
|
|
ECHO "\n End of Test\n"
|
2019-02-21 21:19:56 +00:00
|
|
|
|
MAN
|
|
|
|
|
TEXT /MAKE/USR/SHARE/TESTS/IFSTRTEST
|