小编use*_*123的帖子

用于检查进程是否已在运行的Shell脚本,如果是,则退出

我有一个shell脚本,方法status()start().代码如下:

#function to check the jmeter processes running
status(){
     PID=$(ps -ef | grep jmeter|grep -v grep)
     echo "The jmeter processes running are: \n$PID"
}

#function to run the .jmx file given by the user at run time
start(){
     echo "Please enter the file name .jmx extension"
     read file
     echo "Please enter the log file name .jtl extension"
     read log_file
     sh /home/ubuntu/apache-jmeter-3.0/bin/jmeter.sh -n -t $file -l $log_file &
}
while [ "$1" != "" ]; do
case …
Run Code Online (Sandbox Code Playgroud)

linux bash shell scripting-language jmeter

5
推荐指数
1
解决办法
2178
查看次数

标签 统计

bash ×1

jmeter ×1

linux ×1

scripting-language ×1

shell ×1