% ./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!
- Show Hide SharePoint column in List Library form with the conditional formula - SharePoint
- Android read text file from internal storage - Android
- Get Browser Screen Width and Height dynamically using jQuery - jQuery
- How to repeat background image in Android Activity - Android
- Convert Java Array to ArrayList Code Example - Java
- How to turn on Bluetooth on Windows 10 - Microsoft
- How to uninstall GarageBand from Mac - MacOS
- Delete blank lines in a file using Notepad++ - NotepadPlusPlus
- Aw Snap! Something went wrong while displaying this webpage Error code: STATUS_INVALID_IMAGE_HASH - Chrome
- How to update SharePoint List Item programmatically using C#.Net - SharePoint
- Notepad++ sort by name with example - NotepadPlusPlus
- PHP drag and drop file upload tutorial using dropzone.js - PHP
- Can we move apps like WhatsApp, Facebook to external MicroSD card - WhatsApp
- ADT Installation Error: requires plug-in org.eclipse.wst.sse.ui - Android
- Struts 2 : There is no Action mapped for namespace [/] and action name [form] associated with context path [/proj] - Java
- How to enable Do Not Disturb (DND) mode in Microsoft Teams - Teams
- Eclipse Error : The Eclipse executable launcher was unable to locate its companion shared library. - Eclipse
- Instant Run requires Tools | Android | Enable ADB integration to be enabled - Android-Studio