-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli10.check
executable file
·44 lines (38 loc) · 1.92 KB
/
cli10.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
function not_passed() {
echo "NOT Passed: check condition leading to line '$1' of '$0'"
exit -1
}
if [ ! -f "cli10.log" ] ; then not_passed $LINENO ; fi
if [ ! -f "cli10-mol-0.inp" ] ; then not_passed $LINENO ; fi
if ! grep -q -i "^[[:space:]]*Si[[:space:]]*.*[[:space:]]*.*[[:space:]]*.*$" "cli10-mol-0.inp" ; then not_passed $LINENO ; fi
if ! grep -q -i "^[[:space:]]*Mult[[:space:]]*3$" "cli10-mol-0.inp" ; then not_passed $LINENO ; fi
n=0; n=$(grep -c -i "^[[:space:]]*Cl .*$" cli10-mol-0.inp)
if [ 2 != "$n" ] ; then not_passed $LINENO ; fi
n=0; n=$(grep -c -i "^[[:space:]]*C .*$" cli10-mol-0.inp)
if [ 13 != "$n" ] ; then not_passed $LINENO ; fi
n=0; n=$(grep -c -i "^[[:space:]]*Ge .*$" cli10-mol-0.inp)
if [ 0 != "$n" ] ; then not_passed $LINENO ; fi
n=0; n=$(grep -c -i "^[[:space:]]*Si .*$" cli10-mol-0.inp)
if [ 1 != "$n" ] ; then not_passed $LINENO ; fi
if [ ! -f "cli10-mol-1.inp" ] ; then not_passed $LINENO ; fi
n=0; n=$(grep -c -i "^[[:space:]]*O .*$" cli10-mol-1.inp)
if [ 4 != "$n" ] ; then not_passed $LINENO ; fi
n=0; n=$(grep -c -i "^[[:space:]]*C .*$" cli10-mol-1.inp)
if [ 10 != "$n" ] ; then not_passed $LINENO ; fi
n=0; n=$(grep -c -i "^[[:space:]]*Ge .*$" cli10-mol-1.inp)
if [ 0 != "$n" ] ; then not_passed $LINENO ; fi
n=0; n=$(grep -c -i "^[[:space:]]*Si .*$" cli10-mol-1.inp)
if [ 0 != "$n" ] ; then not_passed $LINENO ; fi
if [ ! -f "cli10-mol-2.inp" ] ; then not_passed $LINENO ; fi
n=0; n=$(grep -c -i "^[[:space:]]*Ge .*$" cli10-mol-2.inp)
if [ 1 != "$n" ] ; then not_passed $LINENO ; fi
n=0; n=$(grep -c -i "^[[:space:]]*Si .*$" cli10-mol-2.inp)
if [ 2 != "$n" ] ; then not_passed $LINENO ; fi
n=0; n=$(grep -c -i "^[[:space:]]*O .*$" cli10-mol-2.inp)
if [ 0 != "$n" ] ; then not_passed $LINENO ; fi
n=0; n=$(grep -c -i "^[[:space:]]*C .*$" cli10-mol-2.inp)
if [ 1 != "$n" ] ; then not_passed $LINENO ; fi
if grep -q 'Termination status: 0' "cli10.log" ; then echo Passed ; exit 0 ; fi
not_passed $LINENO
exit -1