-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli8.check
executable file
·29 lines (20 loc) · 1.01 KB
/
cli8.check
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
#!/bin/bash
function not_passed() {
echo "NOT Passed: check condition leading to line '$1' of '$0'"
exit -1
}
if [ ! -f "cli8.log" ] ; then not_passed $LINENO ; fi
if [ ! -f "cli8.inp" ] ; then not_passed $LINENO ; fi
if ! grep -q -i "^!" "cli8.inp" ; then not_passed $LINENO ; fi
if ! grep -q -i "^%coords" "cli8.inp" ; then not_passed $LINENO ; fi
if ! grep -q -i "^[[:space:]]*charge *0[[:space:]]*$" "cli8.inp" ; then not_passed $LINENO ; fi
if ! grep -q -i "^[[:space:]]*mult *3[[:space:]]*$" "cli8.inp" ; then not_passed $LINENO ; fi
if ! grep -q -i "^!.*cpcm(acetonitrile)[[:space:]]*$" "cli8.inp" ; then not_passed $LINENO ; fi
if ! grep -q -i "^%geom" "cli8.inp" ; then not_passed $LINENO ; fi
n=0; n=$(grep -c -i "^[[:space:]]*{ B .* C }[[:space:]]*$" cli8.inp)
if [ 4 != "$n" ] ; then not_passed $LINENO ; fi
n=0; n=$(grep -c -i "^[[:space:]]*H .*$" cli8.inp)
if [ 4 != "$n" ] ; then not_passed $LINENO ; fi
if grep -q 'Termination status: 0' "cli8.log" ; then echo Passed ; exit 0 ; fi
not_passed $LINENO
exit -1