forked from curtisbright/PhysicsCheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathverify-cc.sh
executable file
·34 lines (28 loc) · 971 Bytes
/
verify-cc.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
#!/bin/bash
#set -x
o=$1 #first index of cube files to check within directory d
i=$2 #last index of cube files to check within directory d
n=$3 #order
d=$4 #all log files should be stored in a directory
cd $d
touch verified.txt #create a file for verification
chmod u+x verified.txt #make the file writeable
for index in $(seq $o $i)
do
find . -name "*_$index.out" -print0 | while read -d $'\0' file
do
if ! grep -q "error" $file; then
if grep -q "UNSATISFIABLE" $file; then
if grep -q "Number of solutions" $file; then
number=( $(grep "Number of solutions" $file | cut -f2 -d:) )
echo "$index $number" >> verified.txt
fi
else
echo "error" >> verified.txt
fi
else
echo "error" >> verified.txt
fi
done
done
grep "error" verified.txt