Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Exporting arrays
- X-seq: zsh-users 1217
- From: mason@xxxxxxxxxxxxxxx (Geoff Wing)
- To: zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: Exporting arrays
- Date: 12 Jan 1998 03:51:08 GMT
- Organization: A poorly-installed InterNetNews site
- References: <19980111181603.60292@xxxxxxxxxxxxxxxxxxxxxxx>
- Reply-to: mason@xxxxxxxxxxxxxxx
Adam Spiers <adam@xxxxxxxxxxxxxxxxxxxxxxx> typed:
:% foo=(a b c)
:% typeset | grep zzz
:array foo=(a b c)
:% export foo=(a b c)
:% typeset | grep zzz
:array exported foo=(a b c)
:However,
:
:% unset foo
:% export foo=(a b c)
:% typeset | grep zzz
:exported foo='(a b c)'
:Presumably there's a decent reason for this behaviour; would
:someone be good enough to explain it to me?
One important thing to note is that there is no defined method for exporting
arrays. You can only export text strings. In the first case, even though it
says 'array exported foo=(a b c)' it won't be exported as anything, though
it will be used in the current shell as an array. In the second, well,
you haven't previously told it that foo is an array but you've said you
want to export it, so it'll make it something it can export, ie. a string.
--
Geoff Wing [gcw@xxxxxxxxx] Phone : +61-3-9818 2977
Technical Manager: PrimeNet Computer Consultants Facsimile: +61-3-9818 5155
Work URL: http://www.primenet.com.au/ Mobile : 0412 162 441
Ego URL: http://pobox.com/~gcw/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author