Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a list to function

Status
Not open for further replies.

Mag0007

MIS
Feb 15, 2005
829
US
How do I pass a list to a function?

Example:
d= / /home/user /home/user1 /home/user988

I am doing something like this:
function1 ()
{
LIST=$1
}

function $d

But it seems only "/" is being passed.

thx


 
function1 ()
{
for i
do echo $i
done
}
function1 / /home/user /home/user1 /home/user988

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Use quotes:

function1 "$@" "arg2 arg2a" arg3

[3eyes]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top