summaryrefslogtreecommitdiff
path: root/evaluator.sh
diff options
context:
space:
mode:
authorFeideus <erwan.ulrich@gmail.com>2018-05-09 17:10:28 +0200
committerFeideus <erwan.ulrich@gmail.com>2018-05-09 17:10:28 +0200
commit56d39755f33fde6a436d17556c1a4bffc1be4975 (patch)
tree311937681e860ee68f6f5419c4932c45af0d60a5 /evaluator.sh
downloadschemafuzz-56d39755f33fde6a436d17556c1a4bffc1be4975.tar.gz
schemafuzz-56d39755f33fde6a436d17556c1a4bffc1be4975.tar.bz2
schemafuzz-56d39755f33fde6a436d17556c1a4bffc1be4975.zip
commit from the sky
Diffstat (limited to 'evaluator.sh')
-rw-r--r--evaluator.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/evaluator.sh b/evaluator.sh
new file mode 100644
index 0000000..07929b1
--- /dev/null
+++ b/evaluator.sh
@@ -0,0 +1,32 @@
+
+#!/bin/bash
+
+RESULT="$(psql -d sample_database2 -c 'SELECT * FROM TEST_TABLE')";
+RESULT=$( echo $RESULT | grep -P -o "\- .*" )
+RESULT=$( echo $RESULT | cut -d "-" -f 2 )
+RESULT=$( echo $RESULT | cut -d "(" -f1 )
+IFS=' | ' read -ra array <<< "$RESULT"
+
+SCORE=0
+
+if [ "${array[1]}" = "Moy" ]
+then
+ SCORE=$((SCORE+10))
+fi
+
+if [ "${array[2]}" = "t" ]
+then
+ SCORE=$((SCORE+10))
+fi
+
+if [[ "${array[0]}" -eq 32767 ]]
+then
+ SCORE=$((SCORE+10))
+fi
+
+if [[ ${array[0]} -eq 32767 && "${array[2]}" = "t" && "${array[1]}" = "Moy" ]]
+then
+ SCORE=-1
+fi
+
+echo $SCORE