Problem in argument passing

Hell all,

i have a problem in argument passing.

print()
{
a=$1
b=$2
c=$3

echo $a
echo $b
echo $c
}

x="1 2 3"
y="4 5 6"
z="7 8 9"

print $x $y $z.

i am passing x,y and z to the function print.

it has to take the x , y and z . and it has to print as bellow

1 2 3
4 5 6
7 8 9

but it is printing as bellow.
1
2
3.

Since the values are seperated by space. it is accepting the first variable x alone.

how to solve this?.

Quote the arguments properly.

use double quotes around variables and arguments.

And don't use the name print as a function name, in ksh it's a built-in function!

Regards

Change the function call to look like below :

print "${x}" "${y}" "${z}"

This should have worked , and yes as said by Franklin "print" is a buitin word in shell.