I am new to shell script and I am working on shell scripting for jmeter. So far to run a jmeter script, I have written my shell script like below:
#! 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
I have a stop method to terminate the process. Here, for this script I am asking the user to enter the .jmx
fileName and .jtl
fileName in different lines. But I want the user to be able to pass the .jmx
fileName and .jtl
fileName at the time he types the command to execute the script.
example: $ ./script.sh .jmx fileName .jtl fileName
then, the script should run.
I don't know how to do it. Can someone please help?