From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,RDNS_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 Received: (qmail 18657 invoked from network); 25 Mar 2020 23:34:43 -0000 Received-SPF: pass (primenet.com.au: domain of zsh.org designates 203.24.36.2 as permitted sender) receiver=inbox.vuxu.org; client-ip=203.24.36.2 envelope-from= Received: from unknown (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTP; 25 Mar 2020 23:34:43 -0000 Received: (qmail 18601 invoked by alias); 25 Mar 2020 23:34:36 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45619 Received: (qmail 9619 invoked by uid 1010); 25 Mar 2020 23:34:36 -0000 X-Qmail-Scanner-Diagnostics: from wout4-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25758. spamassassin: 3.4.2. Clear:RC:0(64.147.123.20):SA:0(-2.6/5.0):. Processed in 0.703091 secs); 25 Mar 2020 23:34:36 -0000 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrudehhedgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfgjfhfogggtgfesthejtddtredtvdenucfhrhhomhepffgrnhhi vghlucfuhhgrhhgrfhcuoegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrghmvgeqne cukfhppeejledrudejiedruddvhedrvdefvdenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrg hmvg X-ME-Proxy: Date: Wed, 25 Mar 2020 23:33:59 +0000 From: Daniel Shahaf To: Shane Squires Cc: zsh-workers@zsh.org Subject: Re: "export FOO" twice behaves differently than "export FOO" once Message-ID: <20200325233359.0ce0ec7a@tarpaulin.shahaf.local2> In-Reply-To: References: X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Shane Squires wrote on Sat, 21 Mar 2020 14:35 -0700: > I wanted to report some unusual behavior with the export command. This is > for the usage where a variable is exported without being given a value. > Exporting a variable twice seems to add it to the environment, but > exporting it once does not. See shell output below. > > % echo $ZSH_VERSION > 5.3.1 > % unset FOO > % export FOO > % /usr/bin/env | grep FOO > % export FOO > % /usr/bin/env | grep FOO > FOO= > > Is this an expected behavior? I can see an argument for either behavior > (either adding FOO to the environment or not adding it) when no value is > given. But it seems like the behavior should be consistent whether > exporting once or twice. I'm not sure whether it's expected, but I can reproduce it in master. Thanks, Daniel