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

/wait-for-it.sh: 75: /wait-for-it.sh: Syntax error: "(" unexpected (expecting ";;") #69

Open
ChadLei opened this issue Jul 2, 2019 · 11 comments

Comments

@ChadLei
Copy link

ChadLei commented Jul 2, 2019

/wait-for-it.sh: 75: /wait-for-it.sh: Syntax error: "(" unexpected (expecting ";;")
error when trying to build with a openjdk:8-jre image

@baptooo
Copy link

baptooo commented Jul 4, 2019

Hello @ChadLei, I had the same issue here but it was because I was executing the command with sh like this:

$ sh ./wait-for-it.sh www.google.com:80

I removed the sh command and it worked for me.

$ ./wait-for-it.sh www.google.com:80

@ChadLei
Copy link
Author

ChadLei commented Jul 5, 2019

great tip thanks!

@warthur1214
Copy link

I have a same problem.
run sh ./wait-for-it.sh www.google.com:80 on openjdk:8-jre image.

Why I mast run sh command.
Because there is not bash command

@HasBert
Copy link

HasBert commented Aug 4, 2019

I got the exact same problem with alpine:3.7, when running

sh wait-for-it.sh www.google.com:80

I don't have bash installed, so the fix of @baptooo is not working for me.
AS mentioned here the parenthesis are for executing sub-processes in bash.
Any thoughts about how to solve that problem?

@warthur1214
Copy link

warthur1214 commented Aug 5, 2019

@HasBert You need install bash. Try this:

apk add --no-cache bash
./wait-for-it.sh www.google.com:80

@identitymonk
Copy link

it works but the correct command is:
apk add --no-cache bash

There was a typo in @warthur1214 suggestion cause of two add

@warthur1214
Copy link

warthur1214 commented Aug 9, 2019

@identitymonk sorry to puzzle you. I forgot to remove 'add'

@mikaelengstrom
Copy link

Would it not be cleaner to make the script compatible with sh rather than enforce bash on minimalistic containers? Any thoughts?

@srdecny
Copy link

srdecny commented Sep 15, 2020

If you get this error while being sure you're running this with bash, make sure the first line of the script contains the shebang. (I put a link to the repo as a comment as the first line 😅 )

@pjebs
Copy link

pjebs commented Dec 14, 2020

maybe this will work: #80

@azhar1038
Copy link

maybe this will work: #80

The ash script worked!

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

10 participants