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

Re: env variables



Nik Gervae <Nik@xxxxxxx> typed:
:> Arrays aren't exported, because there's no standard or de facto method of
:> exporting arrays, so nothing would understands them.  Only strings are
:> exported.  From your example, CDPATH is a string, cdpath is an array.
:Hmm. That sounds slightly fishy in that csh happily exports array
:variables, but then csh is bogus in so many ways.... I've managed

Not as arrays.  In fact, I can't see it doing it at all.
% csh -f
% set | fgrep "(" | cut -f1
argv
path
% env | egrep -i "^(argv|path)" | cut -f1 -d=
PATH

    but PATH is a colon separated string.  path is a space separated string
    which is pretending to be an array.  You could export it as such but it
    would be useless.  What happens when an element in the array has a space
    in it?

% set l=(a b "c d")
% foreach i ($l)
? echo $i
? end
a
b
c
d
% zsh -f
% l=(a b "c d")
% foreach i ($l); echo $i; end
a
b
c d

-- 
Geoff Wing   <gcw@xxxxxxxxx>            Mobile : 0412 162 441
Work URL: http://www.primenet.com.au/   Ego URL: http://pobox.com/~gcw/



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