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

Author: FAR5HIDCreated Oct 6, 2022Updated Nov 23, 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?