% ./script.sh zsh: permission denied: ./script.sh
If you are trying to execute a script on the Terminal using the Zsh shell and you get permission denied then make sure that the script has the execute permissions. You can do that by using the ls command.
Adding execute permission to the file:
% ls -ltrh total 2832 -rw-r--r-- 1 code2care staff 5B Jul 19 11:50 script.sh
Use the chmod command to add execute (x) permissions to the script.
chmod +x script.sh
Now if I try to run the script again it works!
% ./script.sh Hello, World!
Have Questions? Post them here!
- Ubuntu zsh: command not found: nano
- Setting up Zsh Syntax Highlighting
- Fix for zsh: command not found: brew
- Fix - zsh: command not found: conda [macOS]
- Resolve - zsh: command not found: code
- How to make zsh as the default shell on Ubuntu
- zsh: exec format error eclipse M1 Mac
- [fix] zsh: illegal hardware instruction python TensorFlow M1/M2 Mac
- Fix zsh: permission denied: script.sh
- zsh: command not found [fix] macOS
- Open file using CMD in Notepad++ - NotepadPlusPlus
- Twitter is down? Issues with Tweet create events affecting APIs - Twitter
- How to Upgrade Mac from Monterey to macOS Ventura - MacOS
- Java SE JDBC Select Statement Example - Java
- Eclipse like Auto Import Shortcut in Intelij IDE Android Studio - Android-Studio
- Replace new line with comma in Sublime Text Editor - Sublime-Text
- Auto Execute a command or script on Mac Terminal Startup - MacOS
- Fix Microsoft Teams Admin Center error - The Security zone setting isn't configured correctly - Teams