% ./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!
- How to make zsh as the default shell on Ubuntu
- Fix zsh: permission denied: script.sh
- Fix for zsh: command not found: brew
- Ubuntu zsh: command not found: nano
- zsh: exec format error eclipse M1 Mac
- Resolve - zsh: command not found: code
- Fix - zsh: command not found: conda [macOS]
- zsh: command not found [fix] macOS
- How to stop/start/restart apache server using command [Ubuntu] - Ubuntu
- Fix java.net.ProtocolException: Invalid HTTP method - Java
- JSON Nest Objects Example: JSON Tutorial - Json-Tutorial
- Install specific JRE on Ubuntu using apt - Ubuntu
- Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end users experience - Java
- list of jars required for hibernate 4.x.x - Java
- The Android Virtual Device myEmulator is currently running an emulator and cannot be deleted. - Android
- Your Android SDK is out of date or is missing templates. Please ensure you are using SDK version 22 or later. - Android