2019-02-13 23:45:39 -05:00
|
|
|
|
NEW
|
|
|
|
|
PREFIX
|
|
|
|
|
AUTO 4,1
|
2019-02-18 00:41:06 -05:00
|
|
|
|
#!/BIN/SH
|
2019-02-13 23:45:39 -05:00
|
|
|
|
#
|
|
|
|
|
# We first need to check if this script is being called
|
|
|
|
|
# by BUILDTEST or if it is being run interactively.
|
|
|
|
|
#
|
|
|
|
|
IF [ -F ${ROOT}TMP/BUILDTEST ]
|
|
|
|
|
ELSE
|
|
|
|
|
SET B = 0
|
|
|
|
|
FI
|
|
|
|
|
#
|
|
|
|
|
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
|
|
|
|
|
SET T = $T + 1
|
|
|
|
|
echo \n
|
|
|
|
|
CAT -N CATFILE1
|
|
|
|
|
echo \n
|
|
|
|
|
read -P "Did you see 8 numbered lines: " Z
|
|
|
|
|
IF [ $Z = "y" ]
|
|
|
|
|
SET Z = "Y"
|
|
|
|
|
FI
|
|
|
|
|
IF [ $Z = "Y" ]
|
|
|
|
|
IF [ $B -GT 0 ]
|
|
|
|
|
SET P = $P + 1
|
|
|
|
|
echo "CAT -N Passed" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
ELSE
|
|
|
|
|
IF [ $B -GT 0 ]
|
|
|
|
|
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
|
|
|
|
|
echo \n
|
|
|
|
|
SET T = $T + 1
|
|
|
|
|
CAT -S CATFILE1
|
|
|
|
|
echo \n
|
|
|
|
|
read -P "Did you just 4 lines: " Z
|
|
|
|
|
IF [ $Z = "y" ]
|
|
|
|
|
SET Z = "Y"
|
|
|
|
|
FI
|
|
|
|
|
IF [ $Z = "Y" ]
|
|
|
|
|
IF [ $B -GT 0 ]
|
|
|
|
|
SET P = $P + 1
|
|
|
|
|
echo "CAT -S Passed" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
ELSE
|
|
|
|
|
IF [ $B -GT 0 ]
|
|
|
|
|
SET F = $F + 1
|
|
|
|
|
echo "CAT -S Failed" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
FI
|
|
|
|
|
SET T = $T + 1
|
|
|
|
|
CAT -A CATFILE2
|
|
|
|
|
echo \n
|
|
|
|
|
read -P "Was the CAT display correct: " Z
|
|
|
|
|
IF [ $Z = "y" ]
|
|
|
|
|
SET Z = "Y"
|
|
|
|
|
FI
|
|
|
|
|
IF [ $Z = "Y" ]
|
|
|
|
|
IF [ $B -GT 0 ]
|
|
|
|
|
SET P = $P + 1
|
|
|
|
|
echo "CAT -A Passed" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
ELSE
|
|
|
|
|
IF [ $B -GT 0 ]
|
|
|
|
|
SET F = $F + 1
|
|
|
|
|
echo "CAT -A Failed" >> ${Log}
|
|
|
|
|
FI
|
|
|
|
|
FI
|
|
|
|
|
Echo "\nEnd of Cat Test"
|
|
|
|
|
MAN
|
|
|
|
|
TEXT /MAKE/USR/SHARE/TESTS/CATTEST
|