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

RE: passing arrays



> Here is an extension of the problem.  Say I have a
> bunch of functions that operate on $PATH, how would I
> generalize it so that it works with any $PATH like
> variable?
> 

Hmm ... have you noticed that every your question needs at least one reply
that requests clarification what you really mean? No offence intended :)

Returning to your question - if 

foo "$path[@]"

does what you need I do not see any reason why

foo "$bar[@]"

does not. If the question is, how to get a pair of variables like path/PATH
- it is done with typeset,

typeset -T FOO foo

creates an array foo and "colon array" FOO.

-andrey



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