jmeter-ec2 icon indicating copy to clipboard operation
jmeter-ec2 copied to clipboard

(standard_in) 1: syntax error

Open Mat89189 opened this issue 8 years ago • 5 comments

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

Mat89189 avatar Nov 28 '16 22:11 Mat89189

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.

oliverlloyd avatar Nov 28 '16 23:11 oliverlloyd

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.

oliverlloyd avatar Nov 28 '16 23:11 oliverlloyd

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.

oliverlloyd avatar Nov 29 '16 11:11 oliverlloyd

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

Mat89189 avatar Nov 29 '16 18:11 Mat89189

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

baranga avatar Jul 31 '17 13:07 baranga