Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Passing array to function



I have the following function:

addtoarray() { [[ -d $1 ]] && myarray=($1 $myarray) }

which works as expected, prepending an element to an array only if its an
existing directory.  I'd like to rewrite this function so that I can pass
the array name as a parameter like so:

addtoarray /usr/foo myarray

but I can't figure out how.  I've tried everything I can think of without
any success.

Thanks



Messages sorted by: Reverse Date, Date, Thread, Author