【发布时间】:2016-07-04 21:28:49
【问题描述】:
我是 shell 脚本的新手,我正在为 jmeter 编写 shell 脚本。到目前为止,为了运行 jmeter 脚本,我编写了如下的 shell 脚本:
#! bin/sh
start(){
echo "Please enter the file name .jmx extension"
read file
echo "Please enter the log file name .jtl extension"
read log_file
jmeter.sh -n -t $file -l $log_file
}
while [ "$1" != "" ]; do
case "$1" in
start )
start
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
esac
shift
done
我有一个停止方法来终止进程。在这里,对于这个脚本,我要求用户在不同的行中输入.jmx 文件名和.jtl 文件名。但我希望用户在键入命令执行脚本时能够传递.jmx 文件名和.jtl 文件名。
例如:$ ./script.sh .jmx fileName .jtl fileName 那么,脚本应该运行。
我不知道该怎么做。有人可以帮忙吗?
【问题讨论】:
标签: linux bash shell jmeter scripting-language