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

Script timesout (No such file or directory) while running with bash command #125

Open
FAR5HID opened this issue Oct 6, 2022 · 2 comments

Comments

@FAR5HID
Copy link

FAR5HID commented Oct 6, 2022

System: fedora 35

Trying to run the script without +x execution permission using bash command.
bash wait-for-it.sh google.com:80

timeout: failed to run command ‘wait-for-it.sh’: No such file or directory
wait-for-it.sh: timeout occurred after waiting 15 seconds for google.com:80

(The error message is same for above case even if execution permission is given)

But it works when directly executed given +x.
./wait-for-it.sh google.com:80

wait-for-it.sh: waiting 15 seconds for google.com:80
wait-for-it.sh: google.com:80 is available after 1 seconds

Any way I can use the script without giving it execution permission?

@svex99
Copy link

svex99 commented Nov 23, 2022

It works when you give +x permissions and use ./ because that is the intended behavior by the system.

Check the accepted answer for details: Why do I need to type ./ before executing a program in the current directory?

I don't think you can execute it without the required permission.

@FAR5HID
Copy link
Author

FAR5HID commented Nov 23, 2022

I get that, about the path issue. Turns out the script calls itself during execution, for that it needs the +x permission.

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

2 participants