Passing a parameter while calling a script

Hello everyone

I was asked to pass a parameter in the calling of a script. I�ll have two parameters London and Birmingham and I�ll need to pass this because each of these will have a specific script however with the same name.

/home/script/loaddata.ksh Lond

/home/script/loaddata.ksh Birm

My question is how can I do it, and how can I configure the scripts?

Best Regards & Best luck for all

Rafael Buria

I'm not sure what you mean, but when you want to compare the parameter passed in the script you should compare the $1 in the script (think this is very basic)..
so if this is what you want, you should do something like this:

if [ $1 == 'Lond' ]
then
... do something in London ...
else if [ $1 == 'Birm' ]
then
... something in Birmingham ....
fi
fi

But I think I misunderstood the question, so please explain a bit more.

Hello Sir and thanks for the answer... It�s a little bit hard to explain what I want in this....

I need to make the call of some script and pass a parameter like a sad I have two of them Lond and Birm....I really do not know how to make this "call" of my script passing the parameter and I do not know how the script will understand that when I pass Lond it will run the script for London. The comparison I think that will be made inside the script but I don�t know if I�ll have to use an auxiliar script to check the call....