View Single Post
Old May 18th, 2006, 3:35 AM   #8
DaveQB
Newbie
 
DaveQB's Avatar
 
Join Date: Apr 2006
Location: Sydney
Posts: 14
Rep Power: 0 DaveQB is on a distinguished road
Send a message via ICQ to DaveQB Send a message via Skype™ to DaveQB
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"
DaveQB is offline   Reply With Quote