diff --git a/tests/script/loop.sh b/tests/script/loop.sh new file mode 100755 index 0000000000000000000000000000000000000000..d41fe8d4aa28c2b261f14557ff085fbac0460fa8 --- /dev/null +++ b/tests/script/loop.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +################################################## +# +# Do simulation test +# +################################################## + +set +e +#set -x + +CMD_NAME= +LOOP_TIMES=5 + +while getopts "f:t:" arg +do + case $arg in + f) + CMD_NAME=$OPTARG + ;; + t) + LOOP_TIMES=$OPTARG + ;; + ?) + echo "unknow argument" + ;; + esac +done + +echo LOOP_TIMES ${LOOP_TIMES} +echo CMD_NAME ${CMD_NAME} + +for (( i=0; i<$LOOP_TIMES; i++ )) +do + echo loop $i + echo cmd $CMD_NAME + $CMD_NAME +done