forked from thulab/iot-benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrep-benchmark.sh
More file actions
executable file
·34 lines (28 loc) · 998 Bytes
/
rep-benchmark.sh
File metadata and controls
executable file
·34 lines (28 loc) · 998 Bytes
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
#!/bin/bash
#组实验配置文件名,文件中一行对应一次实验的一个变化参数如LOOP=10,注意等号两边不能有空格
FILENAME=routine
if [ -z "${BENCHMARK_HOME}" ]; then
export BENCHMARK_HOME="$(cd "`dirname "$0"`"/.; pwd)"
fi
#cat $BENCHMARK_HOME/$FILENAME | while read LINE
FILE=$(cat $BENCHMARK_HOME/$FILENAME)
#echo $FILE
#实际上LINE是以换行或空格为分隔符
for LINE in $FILE;
do
CHANGE_PARAMETER=$(echo $LINE | cut -d = -f 1)
#CHANGE_LINE=$(grep -n $CHANGE_PARAMETER $BENCHMARK_HOME/conf/config.properties | cut -d : -f 1)
#sed -i "${CHANGE_LINE}s/^.*$/${LINE}/" $BENCHMARK_HOME/conf/config.properties
if [ -n "$LINE" ]; then
if [ "$LINE" != "TEST" ]; then
sed -i "s/^${CHANGE_PARAMETER}.*$/${LINE}/g" $BENCHMARK_HOME/conf/config.properties
grep $CHANGE_PARAMETER $BENCHMARK_HOME/conf/config.properties
else
sh $BENCHMARK_HOME/cli-benchmark.sh
fi
fi
done
#for i in {1..5}
#do
# sh cli-benchmark.sh
#done