zsh-users
 help / color / mirror / code / Atom feed
From: mason@primenet.com.au (Geoff Wing)
To: zsh-users@math.gatech.edu
Subject: Re: Exporting arrays
Date: 12 Jan 1998 03:51:08 GMT	[thread overview]
Message-ID: <slrn6bj4pc.m2f.mason@coral.primenet.com.au> (raw)
In-Reply-To: <19980111181603.60292@thelonious.new.ox.ac.uk>

Adam Spiers <adam@thelonious.new.ox.ac.uk> 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/


  reply	other threads:[~1998-01-12  4:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-11 18:16 Adam Spiers
1998-01-12  3:51 ` Geoff Wing [this message]
1998-01-12  9:01 ` Peter Stephenson
1998-01-12 10:45 ` Andrew Main
1998-01-12 13:48   ` Bernd Eggink
1998-01-12 15:15     ` Andrew Main
1998-01-12 21:24       ` Bernd Eggink
1998-01-12 22:12       ` Adam Spiers
1998-01-12 23:15         ` Mirar
1998-01-13  1:39           ` Adam Spiers
1998-01-13 14:12             ` Mirar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=slrn6bj4pc.m2f.mason@coral.primenet.com.au \
    --to=mason@primenet.com.au \
    --cc=zsh-users@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).