How to pass arguments to a function in a shell script?

Hi,
I have two shell variables $t1 and $t2 which I need to pass to a function in a shell script. The function will do some computation with those two variables and echo the resultant. But I do not know how to pass teh arguments.
The function written is
f1()
{......
........
}

What should be the syntax to pass arguments $t1 and $t2 to this function.
Help would be appreciated!

.....

in bash the variables are global, so a variable established somewhere else can be used an a separate function. i am not sure about variables assigned in another function however. check out tldp.org and search for the "advanced bash shell scripting guide", if youre using bash.

Hi Preeti

You can pass variables to functions and use them within for modification. Once you exit the function, the variables still continue to hold the same values. So you need not worry abt the changes as long as your vaiable names within the function and outside the function are same.

Else you can do as follows :-

example_func()
{
echo "Var1 is $1"
echo "Var2 is $2"
Var1=`echo $Var1 + 10`
Var2=`echo $Var2 + 15`
echo "Var1 is $Var1"
echo "Var2 is $Var2"
}

-
-
example_func $Var1 $Var2
-
-