How To Write Script in Linux Programming

in this topic describe to how to write and run shell script in linux.following step are required to write shell script in linux.

1.Use any editor like vi,gedit to write shell script

2.in this topic used vi editor to write a shell script.Open terminal type $vi [script_name].sh then press insert key to transfer from command to insert mode.

3.Write your script

4.To store your script press ESC key and write :wq then enter

5.Now execute your scrip like this $sh [scrip_name].sh

Example



$vi script1.sh
#
#Hello Reader This is Shell Script Example Using Vi Editor
#
echo "Veewom"
#Press Esc
#:wq Save Script
#Execute Script
$sh script1.sh
Veewom
							
Share Share on Facebook Share on Twitter Share on Google+ Share on LinkedIn Pin on Pinterest Share on Stumbleupon Share on Tumblr Share on Reddit Share on Diggit