Below is the code template:
#!/bin/bash
# content of your script
This is called a shebang line which tells the OS what program it should execute. Here, it’s bash.
Code to make the file executable:
chmod 755 foo.sh
Code to execute the script :
./foo.sh
Interested in Linux? Check out this Linux Certification by Intellipaat.