wait-for-it
wait-for-it copied to clipboard
/wait-for-it.sh: 75: /wait-for-it.sh: Syntax error: "(" unexpected (expecting ";;")
/wait-for-it.sh: 75: /wait-for-it.sh: Syntax error: "(" unexpected (expecting ";;") error when trying to build with a openjdk:8-jre image
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
great tip thanks!
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
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?
@HasBert You need install bash. Try this:
apk add --no-cache bash
./wait-for-it.sh www.google.com:80
it works but the correct command is:
apk add --no-cache bash
There was a typo in @warthur1214 suggestion cause of two add
@identitymonk sorry to puzzle you. I forgot to remove 'add'
Would it not be cleaner to make the script compatible with sh rather than enforce bash on minimalistic containers? Any thoughts?
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 :sweat_smile: )
maybe this will work: https://github.com/vishnubob/wait-for-it/pull/80
maybe this will work: #80
The ash script worked!