forked from ESCOMP/CTSM
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCLM_compare.sh
executable file
·39 lines (33 loc) · 949 Bytes
/
CLM_compare.sh
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
36
37
38
39
#!/bin/sh
#
if [ $# -ne 2 ]; then
echo "CLM_compare.sh: incorrect number of input arguments"
exit 1
fi
echo "CLM_compare.sh: comparing $1 "
echo " with $2"
##note syntax here as stderr and stdout from cprnc command go
##to separate places!
${CPRNC_EXE} ${CPRNC_OPT} $1 $2 2>&1 > cprnc.out
rc=$?
if [ $rc -ne 0 ]; then
echo "CLM_compare.sh: error doing comparison, cprnc error= $rc"
exit 2
fi
result_old=`perl -e 'while (my $ll = <>) \
{ if ($ll =~ /(\d+)[^0-9]+compared[^0-9]+(\d+)/) \
{ print "PASS" if $1>0 && $2==0 }}' cprnc.out`
if grep -c "the two files seem to be IDENTICAL" cprnc.out > /dev/null; then
result=PASS
elif grep -c "the two files seem to be DIFFERENT" cprnc.out > /dev/null; then
result=FAIL
else
result=$result_old
fi
if [ "$result" = "PASS" ]; then
echo "CLM_compare.sh: files are b4b"
else
echo "CLM_compare.sh: files are NOT b4b"
exit 3
fi
exit 0