2019-02-14 04:45:39 +00:00
|
|
|
|
NEW
|
|
|
|
|
PREFIX
|
|
|
|
|
AUTO 4,1
|
2019-02-18 05:41:06 +00:00
|
|
|
|
#!/BIN/SH
|
2019-02-14 04:45:39 +00:00
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
ECHO "\f\n\n Cat Test"
|
|
|
|
|
echo "\nThis script will perform tests of the CAT command"
|
|
|
|
|
echo "\nThe first cats a file with line numbers at the left.\n"
|
|
|
|
|
READ -P "Press Return to start test" Z
|
2019-03-07 02:13:28 +00:00
|
|
|
|
IF [ -N $Log ]
|
|
|
|
|
ECHO "Begin CAT Tests" >> ${Log}
|
|
|
|
|
ELSE
|
|
|
|
|
SET T = 0
|
|
|
|
|
SET F = 0
|
|
|
|
|
SET P = 0
|
|
|
|
|
FI
|
2019-02-14 04:45:39 +00:00
|
|
|
|
SET T = $T + 1
|
2019-03-07 02:13:28 +00:00
|
|
|
|
echo "\n"
|
2019-02-22 03:47:12 +00:00
|
|
|
|
CAT -N CATTEXT
|
2019-03-07 02:13:28 +00:00
|
|
|
|
echo "\n"
|
2019-02-14 04:45:39 +00:00
|
|
|
|
read -P "Did you see 8 numbered lines: " Z
|
2019-03-07 02:13:28 +00:00
|
|
|
|
ECHO
|
2019-02-14 04:45:39 +00:00
|
|
|
|
IF [ $Z = "y" ]
|
|
|
|
|
SET Z = "Y"
|
|
|
|
|
FI
|
|
|
|
|
IF [ $Z = "Y" ]
|
2019-03-07 02:13:28 +00:00
|
|
|
|
IF [ -N $Log ]
|
2019-02-14 04:45:39 +00:00
|
|
|
|
SET P = $P + 1
|
|
|
|
|
echo "CAT -N Passed" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
ELSE
|
2019-03-07 02:13:28 +00:00
|
|
|
|
IF [ -N $Log ]
|
2019-02-14 04:45:39 +00:00
|
|
|
|
SET F = $F + 1
|
|
|
|
|
echo "CAT -N Failed" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
FI
|
|
|
|
|
ECHO "\nThis next test CATs the same file but removes"
|
|
|
|
|
ECHO "the duplicate empty lines\n"
|
|
|
|
|
READ -P "Press Return to start test" Z
|
2019-03-07 02:13:28 +00:00
|
|
|
|
echo "\n"
|
2019-02-14 04:45:39 +00:00
|
|
|
|
SET T = $T + 1
|
2019-03-07 02:13:28 +00:00
|
|
|
|
CAT -N -S CATTEXT
|
|
|
|
|
echo "\n"
|
|
|
|
|
read -P "Did you see just 5 lines: " Z
|
|
|
|
|
ECHO
|
2019-02-14 04:45:39 +00:00
|
|
|
|
IF [ $Z = "y" ]
|
|
|
|
|
SET Z = "Y"
|
|
|
|
|
FI
|
|
|
|
|
IF [ $Z = "Y" ]
|
2019-03-07 02:13:28 +00:00
|
|
|
|
IF [ -N $Log ]
|
2019-02-14 04:45:39 +00:00
|
|
|
|
SET P = $P + 1
|
|
|
|
|
echo "CAT -S Passed" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
ELSE
|
2019-03-07 02:13:28 +00:00
|
|
|
|
IF [ -N $Log ]
|
2019-02-14 04:45:39 +00:00
|
|
|
|
SET F = $F + 1
|
|
|
|
|
echo "CAT -S Failed" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
FI
|
2019-03-07 02:13:28 +00:00
|
|
|
|
ECHO "\nThis next test CATs a special file and displays"
|
|
|
|
|
ECHO "its contents in code.\n"
|
2019-02-22 03:47:12 +00:00
|
|
|
|
READ -P "Press Return to start test" Z
|
2019-03-07 02:13:28 +00:00
|
|
|
|
echo "\n"
|
2019-02-14 04:45:39 +00:00
|
|
|
|
SET T = $T + 1
|
2019-02-22 03:47:12 +00:00
|
|
|
|
CAT -A CATCHARS
|
2019-03-07 02:13:28 +00:00
|
|
|
|
ECHO "\n\n"
|
|
|
|
|
ECHO "The following should have been displayed above:"
|
|
|
|
|
ECHO "[ENQ][ACK][BEL][BS][TAB][VT][FF][SI][DLE][DC1][DC2][DC3]"
|
|
|
|
|
ECHO "[DC4][NAK][SYN][ETB][CAN][EM][SUB][ESC][FS][GS][RS][US]"
|
|
|
|
|
ECHO
|
|
|
|
|
read -P "Is that what was displayed: " Z
|
|
|
|
|
ECHO
|
2019-02-14 04:45:39 +00:00
|
|
|
|
IF [ $Z = "y" ]
|
|
|
|
|
SET Z = "Y"
|
|
|
|
|
FI
|
|
|
|
|
IF [ $Z = "Y" ]
|
2019-03-07 02:13:28 +00:00
|
|
|
|
IF [ -N $Log ]
|
2019-02-14 04:45:39 +00:00
|
|
|
|
SET P = $P + 1
|
|
|
|
|
echo "CAT -A Passed" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
ELSE
|
2019-03-07 02:13:28 +00:00
|
|
|
|
IF [ -N $Log ]
|
2019-02-14 04:45:39 +00:00
|
|
|
|
SET F = $F + 1
|
|
|
|
|
echo "CAT -A Failed" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
FI
|
|
|
|
|
Echo "\nEnd of Cat Test"
|
2019-03-07 02:13:28 +00:00
|
|
|
|
IF [ -N $Log ]
|
|
|
|
|
echo "End of Cat Test" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
SET C1 =
|
|
|
|
|
SET D1 =
|
|
|
|
|
SET Z =
|
2019-02-14 04:45:39 +00:00
|
|
|
|
MAN
|
|
|
|
|
TEXT /MAKE/USR/SHARE/TESTS/CATTEST
|