zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi <hzoli@ny.frontiercomm.net>
To: eggink@rrz.uni-hamburg.de (Bernd Eggink)
Cc: zsh-workers@math.gatech.edu
Subject: Re: exporting arrays
Date: Thu, 5 Jun 1997 02:18:40 -0400 (EDT)	[thread overview]
Message-ID: <199706050618.CAA06697@hzoli.home> (raw)
In-Reply-To: <3395B9DA.58C1C527@rrz.uni-hamburg.de> from Bernd Eggink at "Jun 4, 97 08:54:18 pm"

> "ar" shows up in the list, but in the following 'zsh'-invocation it is
> unset. Is this intentional? I didn't find any  restrictions mentioned in
> the manual.

The restriction is in Unix.  The contents of an environment variable is
always a plain null-terminated string on Unix.  It is possible to hack
something as a workaround, but there is no prefect solution as far as I
know.  Neither bash not ksh exports arrays.  More precisely ksh93 does
export arrays but only the first array element gets into the enviromnet
(which is consistent since without subscritps a ksh array behaves like a
variable with the first array element as its value).

Exported functions has similar problems (just try foo='() {' bash to
see what I meen).  Probably that's why ksh93 does not have exported
functions and POSIX does not require it.

The foo()=... encoding to put functions into the environment seems to be
more reasonable and does not have the problem mentioned above.  It was even
included in some early POSIX drafts.  I wonder why doesn't bash use that
method instead of this ambiguous foo='() { ...' encoding.

Zoltan


      reply	other threads:[~1997-06-05  6:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-04 18:54 Bernd Eggink
1997-06-05  6:18 ` Zoltan Hidvegi [this message]

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=199706050618.CAA06697@hzoli.home \
    --to=hzoli@ny.frontiercomm.net \
    --cc=eggink@rrz.uni-hamburg.de \
    --cc=zsh-workers@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).