xxxxxxxxxx
# Add Permissions to your script to be executable.
chmod +x /path/to/yourscript.sh
# Run your script.
/path/to/yourscript.sh
# Or if you're in the right directory.
./yourscript.sh
xxxxxxxxxx
chmod +x file.sh # Give execute permissions to the .sh file
./file.sh # Run the .sh file
xxxxxxxxxx
# Give the script file correct permssions $chmod 744 <name of scipt file e.g script.sh>
$ chmod 744 script.sh
#now the file is ready to run run it with $ ./<name of scirpt file e.g. script.sh>
$ ./script.sh
xxxxxxxxxx
1. Open the terminal. Go to the directory where you want to create your script.
2. Create a file with .sh extension.
3. Write the script (in the file using an editor).
4. Make the script executable with command: chmod +x <fileName>
5. Run the script using: ./<fileName>