[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Passing Information To A Function
From: |
Chris F.A. Johnson |
Subject: |
Re: Passing Information To A Function |
Date: |
Thu, 13 Dec 2001 22:08:21 GMT |
On Thu, 13 Dec 2001, SoloCDM wrote:
> Can an array be passed to a function? If there is a better, I'm
> listening!
Two methods:
xxx() {
xxx_var=( `eval echo \\${$1[@]}` )
echo ${xxx_var[@]}
}
xxy() {
xxx_var=( "$@" )
echo ${xxx_var[@]}
}
qq=( q w e r t y u i o p )
xxx qq
xxy ${qq[@]}
--
Chris F.A. Johnson bq933@torfree.net
=================================================================
c.f.a.johnson@rogers.com http://cfaj.freeshell.org
cfaj@freeshell.org http://members.rogers.com/c.f.a.johnson