From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23275 invoked from network); 12 Jan 1998 04:07:29 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 12 Jan 1998 04:07:29 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id WAA08330; Sun, 11 Jan 1998 22:51:37 -0500 (EST) Resent-Date: Sun, 11 Jan 1998 22:49:55 -0500 (EST) To: zsh-users@math.gatech.edu Path: mason From: mason@primenet.com.au (Geoff Wing) Newsgroups: lists.zsh.users Subject: Re: Exporting arrays Date: 12 Jan 1998 03:51:08 GMT Organization: A poorly-installed InterNetNews site Message-ID: References: <19980111181603.60292@thelonious.new.ox.ac.uk> Reply-To: mason@primenet.com.au NNTP-Posting-Host: coral.primenet.com.au X-Trace: coral.primenet.com.au 884577068 23139 (None) 203.24.36.33 X-Complaints-To: usenet@coral.primenet.com.au X-Newsreader: slrn (0.9.4.3 UNIX) Resent-Message-ID: <"5RCEG3.0.b12.YBPkq"@math> Resent-From: zsh-users@math.gatech.edu X-Mailing-List: archive/latest/1217 X-Loop: zsh-users@math.gatech.edu X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Adam Spiers 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@pobox.com] 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/