-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-script.sh
36 lines (32 loc) · 861 Bytes
/
test-script.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
helpFunction()
{
echo ""
echo "Usage: $0 -a argosfilename -s filename -e epochs"
echo -e "\t-a argosfilename to run"
echo -e "\t-s filename to save the results"
echo -e "\t-e epochs of testing (suggested value 50)"
exit 1 # Exit script after printing help
}
while getopts "a:s:e:" opt
do
case "$opt" in
a ) argosfilename="$OPTARG" ;;
s ) filename="$OPTARG" ;;
e ) epochs="$OPTARG" ;;
? ) helpFunction ;; # Print helpFunction in case parameter is non-existent
esac
done
if [ -z "$argosfilename" ] || [ -z "$filename" ] || [ -z "$epochs" ]
then
echo "Some or all of the parameters are empty";
helpFunction
fi
for i in $(seq "$epochs")
do
argos3 -c $argosfilename | grep ", !!marker!!" | sed 's/, !!marker!!//' >> $filename
a='Simulation'
b='ended'
c="${a} ${i} ${b}"
echo "${c}"
done