Upgraded to Ventura and now unable to run zsh scripts

Any help with this? I upgraded to Ventura and now I am unable to run any of my scripts. Running macOS 13.0.1 (22A400).

I have a simple script:

#!/bin/sh

echo "The script is running"


When I type: test.sh (the name of the script) in the dir where the script is located (so I know it can find the script) I get:


zsh: command not found: test.sh


No idea why this is happening. Apple phone support told me to reload Ventura which doesnt sound like a very good option.

MacBook Pro 14″, macOS 13.0

Posted on Nov 28, 2022 1:11 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 28, 2022 2:16 PM

The Zsh shell would prefer you use the following format, though #!/bin/sh will just run the old Bash 3.2 shell instead.


#!/bin/zsh

echo "The script is running."
exit 0


You must make the script executable and then run it in the current directory by telling Zsh where it is, and dot is just a shortcut to tell the shell that I am right here (.) in this directory location:


chmod +x ./test.sh
./test.sh


I give my Zsh scripts a .zsh extension so the type of script is obvious.

3 replies
Question marked as Top-ranking reply

Nov 28, 2022 2:16 PM in response to nuhuxi

The Zsh shell would prefer you use the following format, though #!/bin/sh will just run the old Bash 3.2 shell instead.


#!/bin/zsh

echo "The script is running."
exit 0


You must make the script executable and then run it in the current directory by telling Zsh where it is, and dot is just a shortcut to tell the shell that I am right here (.) in this directory location:


chmod +x ./test.sh
./test.sh


I give my Zsh scripts a .zsh extension so the type of script is obvious.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Upgraded to Ventura and now unable to run zsh scripts

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.