zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Shane Squires <shane2squires@gmail.com>
Cc: zsh-workers@zsh.org
Subject: Re: "export FOO" twice behaves differently than "export FOO" once
Date: Wed, 25 Mar 2020 23:33:59 +0000	[thread overview]
Message-ID: <20200325233359.0ce0ec7a@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <CAPkN6apJ+V44uOfnvOuWTWwg6SE1i_pVu+ifQh3MhwbjPuy=tw@mail.gmail.com>

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

      reply	other threads:[~2020-03-25 23:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-21 21:35 Shane Squires
2020-03-25 23:33 ` Daniel Shahaf [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=20200325233359.0ce0ec7a@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=shane2squires@gmail.com \
    --cc=zsh-workers@zsh.org \
    /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).