Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(standard_in) 1: syntax error #86

Open
Mat89189 opened this issue Nov 28, 2016 · 5 comments
Open

(standard_in) 1: syntax error #86

Mat89189 opened this issue Nov 28, 2016 · 5 comments

Comments

@Mat89189
Copy link

Mat89189 commented Nov 28, 2016

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

@oliverlloyd
Copy link
Owner

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
Copy link
Owner

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 added a commit that referenced this issue Nov 29, 2016
@oliverlloyd
Copy link
Owner

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.

@Mat89189
Copy link
Author

Mat89189 commented Nov 29, 2016

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

@baranga
Copy link

baranga commented Jul 31, 2017

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

efornaciari pushed a commit to efornaciari/jmeter-ec2 that referenced this issue Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants