When writing shell scripts you can use .sh file extension and run using the sh command.
You can make your shell script executable and run using ./
To make it like this we need to do 2 things:
Change the file permissions
Define the interpreter/shell we will be using in the script.
Changing the file permissions:
Run the command:
chmod 0755 helloWorld.sh
This will allow all users to run the script
To only allow the current user to run the script run:
chmod 0700 helloWorld.sh
Defining the shell within the script:
Add the following line to the start of the script
Depending on which one you are using.
Now you can run your script by typing