3 # Shell script used to test MINIX.
8 echo -n "Shell test 1 "
14 if test -r $f; then : ; else echo sh1 cannot
read $f; exit 1; fi
17 echo "abcdefghijklmnopqrstuvwxyz" >alpha
18 echo "ABCDEFGHIJKLMNOPQRSTUVWXYZ" >ALPHA
19 echo "0123456789" >num
20 echo "!@#$%^&*()_+=-{}[]:;<>?/.," >special
23 cat alpha ALPHA num rc passwd special
>tmp
29 cp /etc
/rc
/etc
/passwd foo
30 if cmp -s foo
/rc
/etc
/rc
; then : ; else echo Error on
cp test 1; fi
31 if cmp -s foo
/passwd
/etc
/passwd
; then : ; else echo Error on
cp test 2; fi
35 cat num num num num num
>y
38 if cmp -s x1 x2
; then : ; else echo Error on
cat test 1; fi
40 if cmp -s y z
; then : ; else echo Error on
cat test 2; fi
43 if test `basename /usr/ast/foo.c .c` != 'foo'
44 then echo Error on
basename test 1
47 if test `basename a/b/c/d` != 'd'; then Error on
basename test 2; fi
49 #Test cdiff, sed, and patch
50 cp $f x.c
# x.c is a copy $f
51 echo "/a/s//#####/g" >s
# create sed script
52 sed -f s
<x.c
>y.c
# y.c is new version of x.c
53 diff -c x.c y.c
>y
# y is cdiff listing
54 patch x.c y
2>/dev
/null
# z should be y.c
55 if cmp -s x.c y.c
; then : ; else echo Error
in cdiff
test; fi
59 ls /etc
>x
# x = list of /etc
60 grep -v "passwd" x
>y
# y = x except for /etc/passwd
61 comm -3 x y
>z
# should only be 1 line, /etc/passwd
63 if cmp -s w z
; then : else echo Error on
comm test 1; fi
65 comm -13 x y
>z
# should be empty
66 if test -s z
; then echo Error on
comm test 2; fi
70 compress -fc $f >x.c.Z
# compress the test file
71 compress -cd x.c.Z
>y
# uncompress it
72 if cmp -s $f y
; then : else echo Error
in compress test 1; fi
76 cp $f x
# copy $f to x
84 ed
2>/dev
/null x
<y
>/dev
/null
92 ed
2>/dev
/null x
<y
>/dev
/null
93 if cmp -s x
$f; then : ; else echo Error
in ed
test 1; fi
97 if test `expr 1 + 1` != 2; then echo Error on
expr test 1; fi
98 if test `expr 10000 - 1` != 9999; then echo Error on
expr test 2; fi
99 if test `expr 100 '*' 50` != 5000; then echo Error on
expr test 3; fi
100 if test `expr 120 / 5` != 24; then echo Error on
expr test 4; fi
101 if test `expr 143 % 7` != 3; then echo Error on
expr test 5; fi
104 if test $a != '101'; then echo Error on
expr test 6; fi
108 if cmp -s alpha z
; then : else echo Error on fgrep
test 1; fi
110 if test -s z
; then echo Error on fgrep
test 2; fi
113 if cmp -s w num
; then : ; else echo Error fgrep
test 3; fi
119 find .
-name Rabbit
-print >z
120 if cmp -s y z
; then : else echo Error on
find test 1; fi
121 find .
-name Bunny
-print >z
122 if test -s z
; then echo Error on
find test 2; fi
127 if cmp -s x alpha
; then : ; else echo Error on
grep test 1; fi
129 if test -s x
; then echo Error on
grep test 2; fi
131 if cmp -s x alpha
; then : ; else echo Error on
grep test 3; fi
132 grep -s "a" XXX_nonexistent_file_XXX
>x
133 if test -s x
; then echo "Error on grep test 4"; fi
134 if grep -s "a" alpha
>x
; then : else echo Error on
grep test 5; fi
135 if grep -s "a" ALPHA
>x
; then echo Error on
grep test 6; fi
139 if cmp -s x alpha
; then : else echo Error on
head test 1; fi
142 if cmp -s x y
; then : else echo Error on
head test 2; fi
157 if cmp -s w w1
; then : ; else echo Error on
ls test 1; fi
164 if test -d Foo
; then : ; else echo Error on mkdir
test 1; fi
165 if test -d Bar
; then : ; else echo Error on mkdir
test 2; fi
167 if test -d Foo
; then echo Error on mkdir
test 3; fi
168 if test -d Foo
; then echo Error on
rmdir test 4; fi
175 if cmp -s $f z
; then : ; else echo Error on
mv test 1; fi
178 if cmp -s $f MVDIR
/y
; then : ; else echo Error on
mv test 2; fi
181 rev <f1 |
head -1 >ahpla
182 echo "zyxwvutsrqponmlkjihgfedcba" >x
183 if cmp -s x ahpla
; then : ; else echo Error on
rev test 1; fi
186 if cmp -s $f x
; then echo Error on
rev test 2; fi
187 if cmp -s $f y
; then : ; else echo error on
rev test 3; fi
197 if cmp -s w
$f; then : ; else echo Error on
shar test 1; fi
198 if cmp -s x alpha
; then : ; else echo Error on
shar test 2; fi
199 if cmp -s y ALPHA
; then : ; else echo Error on
shar test 3; fi
200 if cmp -s z num
; then : ; else echo Error on
shar test 4; fi
206 if cmp -s x1 x2
; then : ; else echo Error on
sort test 1; fi
229 if cmp -s y x1
; then : ; else echo Error on
sort test 2; fi
231 if cmp -s x2 z
; then : ; else echo Error on
sort test 3; fi
232 sort +1 -n <x |
head -1 >y
234 if cmp -s y z
; then : ; else echo Error on
sort test 4; fi
238 if cmp -s x special
; then : ; else echo Error on
tail test 1; fi
268 if cmp -s y answer
; then : ; else echo Error on
tsort test 1; fi
273 if test -s x.uue
; then : ; else echo Error on uue
/uud
test 1; fi
276 if cmp -s x
$f; then : ; else echo Error on uue
/uud
test 2; fi
278 compress -fc x
>x.Z
2>/dev
/null
283 if cmp -s x
$f; then : ; else echo Error on uue
/uud
test 3; fi