jmeter-ec2
jmeter-ec2 copied to clipboard
(standard_in) 1: syntax error
Hi, I get this error:
Requesting 1 instance(s)...success
waiting for instance status checks to pass (this can take several minutes)...
(standard_in) 1: syntax error
./jmeter-ec2.sh: row 967: [: -gt: unary operator expected
[ ] 0,00% - (0 of 1) - ^C
on this row in jmeter-ec2.sh file:
if [ $(echo "$progressPercent>100" | bc) -gt 0 ]; then
Based on this, what if you use:
if [[ $(echo "$progressPercent>100" | bc) -gt 0 ]]; then
Does that solve it?
Also, in general, I'd be interested to see the command you used to run the script and any relevant (non sensitive) settings, like the properties file.
Better yet, this will check to make sure the var progressPercent
has been set (it wasn't in your case).
if [[ -n "${progressPercent}" && $(echo "$progressPercent>100" | bc) -gt 0 ]]; then
Of course, the real issue is why this var wasn't set in the first place but the above will prevent errors when it's not and this is only some code to update the screen with progress so hopefully this doesn't affect overall execution of the script but I can't guarantee that.
I committed the extra checks above, if you're still seeing this error let me know (with the commands and settings you're using) and I can investigate further.
Hi @oliverlloyd , thanks for support. I've modified the script according to your code. I got this error:
Requesting 1 instance(s)...success
waiting for instance status checks to pass (this can take several minutes)...
(standard_in) 1: syntax error
[ ] 0,00% - (0 of 1) - (standard_in) 1: syntax error
[ ] 0,00% - (0 of 1) \
Adding the code (set -x/+x) for debugging I got:
Requesting 1 instance(s)...success
waiting for instance status checks to pass (this can take several minutes)...
+ [[ -n 0,00 ]]
++ echo '0,00>100'
++ bc
(standard_in) 1: syntax error
+ [[ '' -gt 0 ]]
+ set +x
[ ] 0,00% - (0 of 1) - + [[ -n 0,00 ]]
For launching I use this line:
count="1" ./jmeter-ec2.sh
The property file jmeter-ec2.properties is (removed sensitive settings): https://justpaste.it/10wid
I experienced the same issue. Turned out the combination of my locale, printf
and bc
caused the trouble. My current locale is this:
$ env | grep LANG
LANG=de_DE.UTF-8
After changing to english the error disappeared:
$ LANG=en_US jmeter-ec2.sh