问题
I am running a command ./startup.sh nginx:start
and I am getting this error message zsh: permission denied: ./startup.sh
why could this be happening?
回答1:
Be sure to give it the execution permission.
cd ~/the/script/folder
chmod +x ./startup.sh
回答2:
Alternatively you can use bash:
bash startup.sh
Then you don't need execution permission.
In MacOS Catalina, Apple has replaced bash with zsh as default shell. This can mean, that they intend to remove bash in the future, so this might not be an option later, but with Catalina it still works.
回答3:
Starting with macOS Catalina, Your Mac uses zsh as the default login shell and interactive shell. You can make zsh the default in earlier versions of macOS as well.
How to change your default shell Whether your user account is configured to use zsh (recommended), bash, or another shell, you can change the default shell from Users & Groups preferences or the command line.
- From Users & Groups preferences
- Choose Apple menu > System Preferences, then click Users & Groups.
- Click the lock , then enter your account name and password.
- Control-click your user name in the list of users on the left, then choose Advanced Options.
- Choose a shell from the ”Login shell” menu, then click OK to save the changes.
Follow link for more details - https://support.apple.com/en-in/HT208050
来源:https://stackoverflow.com/questions/53229221/terminal-error-zsh-permission-denied-startup-sh