Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: "export FOO" twice behaves differently than "export FOO" once
- X-seq: zsh-workers 45619
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Shane Squires <shane2squires@xxxxxxxxx>
- Subject: Re: "export FOO" twice behaves differently than "export FOO" once
- Date: Wed, 25 Mar 2020 23:33:59 +0000
- Cc: zsh-workers@xxxxxxx
- In-reply-to: <CAPkN6apJ+V44uOfnvOuWTWwg6SE1i_pVu+ifQh3MhwbjPuy=tw@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author