From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24669 invoked by alias); 3 Sep 2010 08:35:08 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 15364 Received: (qmail 1522 invoked from network); 3 Sep 2010 08:35:06 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at seiken.de designates 62.75.149.128 as permitted sender) From: Joke de Buhr To: zsh-users@zsh.org Subject: exporting environment variables to shell functions (maybe bug) Date: Fri, 3 Sep 2010 10:34:30 +0200 User-Agent: KMail/1.13.2 (Linux/2.6.35-19-generic; KDE/4.4.2; x86_64; ; ) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart5944793.QuOZlhHBX2"; protocol="application/pgp-signature"; micalg=pgp-ripemd160 Content-Transfer-Encoding: 7bit Message-Id: <201009031034.47905.joke@seiken.de> --nextPart5944793.QuOZlhHBX2 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I've ask this question a couple of days before but I didn't get any respons= e=20 [1]. I think this may be a bug. If I define a shell function like this one: do_print() { print "__${NAME}__" # print environment variable "NAME" } and later call the function while setting the environment variable "NAME" NAME=3D"hello" do_print the output is "__hello__" as everybody would expect. But if the function is= =20 called this way NAME=3D"hello" # set NAME (no export) NAME=3D"::${NAME}::" do_print # export something as NAME containing $= NAME the output is "__::::__" instead of "__::hello::__". If the same think is d= one=20 using a command instead of a shell function the output is "__::hello::__".= =20 Refer to the older email [1] for a listing of different test cases. [1] http://www.zsh.org/mla/users/2010/msg00644.html --nextPart5944793.QuOZlhHBX2 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQG7BAABAwAlBQJMgLMXHhhoa3A6Ly9wb29sLnNrcy1rZXlzZXJ2ZXJzLm5ldAAK CRCWUloJhwFWxr5rC/9syD3nQoCu3YE0dv1iB2WlfcoDN25LIuQMeX4F5nNc8BCG LGEojLg5ZH5Redpp3oxhD0Y1Q/pVP8h9f1hZG2iEaILndIh2khKBUilymPjuxrdg Jnqa0qiBMq6XQiVJDGYmA+sh6BSeJyw2ifDfkjLztG6lSCkg1ch1WIjovWrdvOTP 3q+Wl2D6wsAJ+WSh/o6psDq6Q1vBtyXLpXuqPyj8ZYXSwsGQG33PpeeWvfkAtFyo iv7EuQ0EQY+81NuTkV3gJEStZrIlMQTi18GhNMMjiBt7GSNmAiKTEnOqP+7hiZpj A2fY29YjT+KzZGcDp3tOAMGlnuIxNh7NQ3NBF7Dvngy7V1iB+lWfEtx6ysOq1qBB riN941iFNAFvyZ6oape/1lLJlxQTwTtGbSvBb50Ks9xOP5KjmJyheKGvoXm0xiF0 aLmncAuWteR+tcKdoWckY8HOW/XmpmBuoVPdXU/yyaKTb7XQj0r+RyriVzMRgAJP ov1PQ3j/na29iRolMDs= =mRHY -----END PGP SIGNATURE----- --nextPart5944793.QuOZlhHBX2--