|
@@ -1,7 +1,32 @@
|
|
1
|
+#!/bin/sh
|
|
2
|
+
|
|
3
|
+set -e
|
|
4
|
+
|
1
|
5
|
./mount.sh
|
2
|
6
|
cat testmnt.txt
|
3
|
7
|
head -c 20 testmnt.txt
|
4
|
8
|
tail -c 20 testmnt.txt
|
5
|
9
|
head -c 160 testmnt.txt | tail -n 1
|
6
|
10
|
echo
|
|
11
|
+
|
|
12
|
+cnt1=`wc -c test1 | (read a b; echo "$a")`
|
|
13
|
+if ! expr "x$cnt1" : 'x[0-9][0-9]*$' > /dev/null; then
|
|
14
|
+ echo 'Could not count the characters in the test1 file'
|
|
15
|
+ exit 1
|
|
16
|
+fi
|
|
17
|
+cnt2=`wc -c test2 | (read a b; echo "$a")`
|
|
18
|
+if ! expr "x$cnt2" : 'x[0-9][0-9]*$' > /dev/null; then
|
|
19
|
+ echo 'Could not count the characters in the test1 file'
|
|
20
|
+ exit 1
|
|
21
|
+fi
|
|
22
|
+cnt3=`wc -c test3 | (read a b; echo "$a")`
|
|
23
|
+if ! expr "x$cnt3" : 'x[0-9][0-9]*$' > /dev/null; then
|
|
24
|
+ echo 'Could not count the characters in the test1 file'
|
|
25
|
+ exit 1
|
|
26
|
+fi
|
|
27
|
+
|
|
28
|
+head -c "$cnt1" testmnt.txt | diff -u test1 -
|
|
29
|
+tail -c "$cnt3" testmnt.txt | diff -u test3 -
|
|
30
|
+cat test1 test2 test3 | diff -u - testmnt.txt
|
|
31
|
+
|
7
|
32
|
./umount.sh
|