blob: c81679dcad06a5948506fbb154a42b341bdb363e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#!/bin/bash
##set -x
FIN=${1:-"/dev/stdin"}
while read EDFILE EDSOURCE; do
IGN=$(echo ${EDFILE} | grep -c "^#")
if [ $IGN = "0" ]; then
printf "test: $EDFILE..."
FILE1=$(tempfile)
FILE2=$(tempfile)
#cat ${EDFILE} | /bin/ed ${EDSOURCE} > ${FILE1} 2>&1
#cat ${EDFILE} | ../myed ${EDSOURCE} > ${FILE2} 2>&1
cat ${EDFILE} | /bin/ed ${EDSOURCE} > ${FILE1} 2>/dev/null
cat ${EDFILE} | ../myed ${EDSOURCE} > ${FILE2} 2>/dev/null
ret=$(diff $FILE1 $FILE2 | tee ${EDFILE}.last_diff | wc -l)
[ "$ret" = "0" ] && echo " PASSED" && rm ${EDFILE}.last_diff
[ "$ret" != "0" ] && echo " FAILED (log in ${EDFILE}.last_diff)"
rm $FILE1 $FILE2
else
echo "${EDFILE}: SKIPPED"
fi
done <$FIN
|