My first Executable Bash Script

1) open the vi editor

2) create file say myscript.sh
# vim myscript.sh

3) add the following line to that file pressing i to make it insert mode
#!/bin/bash
echo "welcome to my 1st script"

4) press esc , press wq! to save come out from the editor
 
5) give the executebale permission
# chmod u+ myscript.sh

6) run theat file
#./myscript.sh

7) you can able to see the following output -
# welcome to my 1st script

Comments