Skip to content
Advertisement

Jmeter Creating/Editing on .sh file linux

can someone help me simulate this scenario, example I will create/update the .sh file. Tried to used “SSH Command Sampler” and used this command “vi testralph123.txt” but it doesn’t work. SSH Command usually works if the Linux command is retrieve like “ls”. Your response is highly appreciated. Thank you so much in advance.

Expected Result: upon invoking a sample it will generate/update .sh file.

Screenshot:

enter image description here enter image description here

Advertisement

Answer

Man, vi command opens an editor in an interactive shell, it is not supported by the SSH Command sampler, I would recommend using something like echo command instead with stream redirection into a file.

Example command would be:

echo "hello from JMeter" > testralph123.txt

It will create testralph123.txt file in your user’s home folder or wherever you’re getting when logging to the system via SSH.

More information: How to Run External Commands and Programs Locally and Remotely from JMeter

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement