Terminal error: zsh: permission denied: ./startup.sh

眉间皱痕 提交于 2020-03-15 20:49:50

问题


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.

  1. From Users & Groups preferences
  2. Choose Apple menu  > System Preferences, then click Users & Groups.
  3. Click the lock , then enter your account name and password.
  4. Control-click your user name in the list of users on the left, then choose Advanced Options.
  5. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!