Quote:
|
Originally Posted by waffch
i will try this, thanks. is that how you do it with shell scripting? i need to write it in .sh format..i need to write my code in vi and then run it then supply my arguments.. first the directory and then the filename..
.:."I'll tell you what's the matter!! This parrot is dead!!".:.
|
Not sure of the question, but I think your asking how to use arguments with shell scripts ??
Each argument is given a number. So the first argument to the file is $1 the second $2 and so forth.
The script itself is $0. Which is handy to use in case the file name changes down the track.
Functions in shell scripts also use this same format, so its wise to assign the arguments to better variables at the start of the script. EG
var_one="$1"
var_two="$2"