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

Rename script to wait-for-it.bash #84

Open
robertp-indeed opened this issue Nov 21, 2019 · 8 comments
Open

Rename script to wait-for-it.bash #84

robertp-indeed opened this issue Nov 21, 2019 · 8 comments

Comments

@robertp-indeed
Copy link

Since this script is a bash script and running it under POSIX sh will fail, it is technically incorrect for it to be named .sh.

@garethrandall
Copy link
Contributor

garethrandall commented Dec 5, 2019

Genuine question: Is this problem solved by the fact that the first line of the script is:
#!/usr/bin/env bash
since this means the system will either find bash or fail immediately (not half-way through the script)? I'm not sure what the POSIX view is on this.

@robertp-indeed
Copy link
Author

The shebang only happens if the script is marked executable and executed like ./wait-for-it.sh. If you explicitly run sh wait-for-it.sh on a system where sh is posix sh (or behaves like it), it fails partway through.

Now, one obvious solution is "ok so don't do that" but the convention is that if it's named .sh, it should be runnable with .sh.

This is, of course, incredibly minor.

@kolomenkin
Copy link
Contributor

sounds reasonable except I never met .bash scripts before. All bash scripts were had .sh extension

@deiga
Copy link

deiga commented Feb 1, 2020

@kolomenkin It is very common to see .zsh or .fish scripts everywhere. Using .bash for script only supporting BASH makes perfect sense. The only time I would be fine with a script which has a bash shebang, but an .sh extensions is when the script is POSIX compliant but wants to run on bash

@lesinigo
Copy link

And this is so much more confusing given that the typical usage of this script will be in docker containers and many of them start out based on Alpine Linux which does have ash as preinstalled shell and it is expected to be fully compatibile with POSIX sh but then wait-for-it.sh fails because it's actually a Bash-only script.

@atkrad
Copy link

atkrad commented Dec 6, 2022

Another solution, use a tool Wait4X that has binary version. 😃

@deiga
Copy link

deiga commented Dec 6, 2022

Another solution, use a tool Wait4X that has binary version. 😃

Please stop spamming the issues here. You posted the same comment multiple times now.

@atkrad
Copy link

atkrad commented Dec 6, 2022

Another solution, use a tool Wait4X that has binary version. smiley

Please stop spamming the issues here. You posted the same comment multiple times now.

I just mentioned a solution. Using a binary tool is a solution, so it doesn't matter if you run on which environment. 😉

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

6 participants