what is shell script and how to use it? starting commands and scripts in linux
Submitted by inder on Wed, 11/19/2008 - 13:36.
"Shell Script is series of linux command written in plain text file . Shell script is just like batch file is MS-DOS but have more power than the MS-DOS batch file e.g it can have the fully programming functionality in it."
- We can use Vi editor in linux for creating linux scripts
- Scripts can be used for talking user input and to make interactive programs
- Script files can be saved and so called again and again like simple linux commands so can save a lot of time.
- Script files can be placed in cron job to automate tasks.
To run script, you need to have in the same directory where you created your script, if you are in different directory your script will not run (because of path settings)
Example:-
[root:inderweb.com] vi scriptfile
var1="This is string"
echo "variable value is $var1"
[root:inderweb.com] chmod -777 scriptfile
[root:inderweb.com] ./scriptgile
variable value is This is string
[root:inderweb.com]
![Validate my RSS feed [Valid RSS]](http://feedvalidator.org/images/valid-rss.png)