-
Notifications
You must be signed in to change notification settings - Fork 1
/
ontodebugger.sh
executable file
·52 lines (35 loc) · 1.06 KB
/
ontodebugger.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
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
iterCount=2
#fixed code begins
regex1="1xxyy([0-9]+)"
filename="odb_parameters.txt"
#total=`eval wc -l $fileName`
JAVA_HOME=/usr/lib/jvm/java-8-oracle
# for each testcase
while read -r line;
do
# echo $line
paramString=$line
command="/home/aidb/netbeans-8.2/java/maven/bin/mvn \"-Dexec.args=-classpath %classpath com.mycompany.ontodebugger.Main "$paramString" \" -Dexec.executable=/usr/lib/jvm/java-8-oracle/bin/java -DskipTests=true -Dmaven.test.skip org.codehaus.mojo:exec-maven-plugin:1.2.1:exec"
#echo $command
echo "" > debuggeroutput.txt
for (( e=0; e<$iterCount; e++ ))
do
eval $command >> debuggeroutput.txt
done
outputString=`cat debuggeroutput.txt`
#echo $outputString
val=0
while [[ $outputString =~ $regex1 ]]; do
# echo "${BASH_REMATCH[1]}"
val=`expr $val + ${BASH_REMATCH[1]}`
outputString=${outputString#*"${BASH_REMATCH[1]}"}
done
result=`expr $val / $iterCount`
echo $line "--" $result"."`expr $val % $iterCount`
#if [[ $outputString =~ $regex1 ]]
#then
#name=${BASH_REMATCH[1]}
#echo $name
#fi
done < "$filename"