In: Computer Science
How would you make the shell script MyScript.sh a standalone executable (i.e. avoid to use source)?
In Linux, by changing the permission of a shell script we can directly execute without any prescribed shell format. When a file is created, the default permission assigned as 644 that means this is not an executable file.
So, by changing the permission of a file (.sh) we can make it executble. i.e. MyScript.sh is a file and we want to make this executable. Follow the commands given below:
chmod u+x MyScript.sh
./MyScript.sh
See the sample in the image given below:
---
Please upvote if the answer helps you. If these is any query, please ask in comments. Thanks.