./ Dot Slash not working to execute Shell Scripts

Multi tool use


./ Dot Slash not working to execute Shell Scripts
I'm definitely a command line novice. I have recently lost the ability to execute shell scripts using
./script.sh
I am still able to execute shell scripts using:
sh script.sh
My $PATH is as follows:
/Users/goodguy/.pyenv/shims:/Users/goodguy/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/opt/local/sbin:/Users/goodguy/.rvm/bin
I am using MacOS. I'd appreciate any insight into what I may be doing wrong
ls -lart script.sh
x
chmod +x script.sh
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Perhaps it doesn't have the executable flag set. Check with
ls -lart script.sh
and look forx
. You can set it to executable usingchmod +x script.sh
– Matthew Darnell
14 mins ago