forked from curtisbright/PhysicsCheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
verify-job-cc.sh
36 lines (30 loc) · 1.18 KB
/
verify-job-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
35
36
#!/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 "UNSATISFIABLE" $file #if a file is successfully solved by MapleSAT, it should output "UNSATISFIABLE"
then
if grep -q "Number of solutions" $file
then
number=( $(grep "Number of solutions" $file | cut -f2 -d:) )
echo "$index $number" >> verified.txt
elif grep -q "error" $file
then
echo "$index error" >> verified.txt
else
number=0
echo "$index $number" >> verified.txt
fi
fi
done
done
grep "error" verified.txt