From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26424 invoked from network); 27 Jun 2022 21:47:50 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 27 Jun 2022 21:47:50 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1656366470; b=p0U/b+N6blrDXJQApUep4fK8Pa5rPS4iUdJXazkv15+sIvRTZbg8DQlamz1mgPH5YyF/tO4gF6 nLP7PQRy1gPDVUc3a/pCarsxDpAQ6BQJ1rI83h5UEJDa8pS663bpYYoY7d977RFr0XRuuNnxyA OQ907PQgyi/mM2BQoapnGSMd2bWsaz4RdJAO92qfH4rwLLim3Uf2plM9NfcEQ9LqTJAhfFd2g4 fraUMI9VL1cJvOKdGf/fEljH70f0MA9mf7AELn4NcYLY+rAZAuPhcs7EEAZzcIwgg4A62mHH9u 88W2rimDaGXO2q0F85aPSkMznHp+f7vY/YVRUeHDM9znHA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f48.google.com) smtp.remote-ip=209.85.167.48; dkim=pass header.d=cloudera.com header.s=google header.a=rsa-sha256; dmarc=pass header.from=cloudera.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1656366470; bh=Q/bEQb4Pr4GirS4cEzdMsmEkSPnBm1CujLPEFWGTCuk=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=J/wMvmeJ7J/2/x9+Xla+4clCOYsa+g4O/6NysrxMZDfr7qEnguI7zPr08AvmHIAfFwtp92T5FM ABu0azKKybEFR39l6jmdt2ORoWQJU37jpendZwmOzeoFixjaDD81vWg9WNGc2lCW2XYpz60rY5 nTh/jjqVhyvsRh2zDSwAdvgZR3eRuIh2TYzA8rqMxPKj5t9gvSOYnE/f4mwnRxUWXG6eo1VyTa qm7xIYq+Fz5IvBybRCgbpIBvOg5D36zOmx3B8Gf3Dw777et+LOS4tY4pMwVF4hAA5E+o3kyhvg bFdkwqU5SPHCvf1gY4fNC3FeYGkOlmZzz4qeFm1J+PGRkA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=13/wlrFmaA0HQ5p7pWlybCad8a5Qp02TWLDgsnmmj50=; b=Bh/6xRu1z8mWnbuAe+b/DRlO5I tPZ/NAD9kML6KMPVMFJHr+YQrM5aV3Owsnv9sOMsBjfZJ4g9T9y+DxWvuW6/G4YrNCpFGj9tZIB3u MxVFaSsfTNB0CfkWB6RHLN06Rnn9xP6sACmCu5mruggHX/d2zpncXkcr1J74L61kkXdIzWJTvUoYO kwXgc3C9n4BOgOX+nnkEEQ0VXfzRhYxEFl1Q5U3iN6x5TL1nJGxN/NXpx2Y1WuafVAfjZQJ9zxJLe 0rEQm5vqLt4Gpkh3TSKczMgpnv4o4CVYgWnG1nOro8b1+dYCaOYIpFkcG1OjAMBw3arJAuieRAHRv kv1ev4qw==; Received: from authenticated user by zero.zsh.org with local id 1o5waD-0009Ll-RR; Mon, 27 Jun 2022 21:47:49 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f48.google.com) smtp.remote-ip=209.85.167.48; dkim=pass header.d=cloudera.com header.s=google header.a=rsa-sha256; dmarc=pass header.from=cloudera.com; arc=none Received: from mail-lf1-f48.google.com ([209.85.167.48]:40942) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1o5wZv-00090z-V4; Mon, 27 Jun 2022 21:47:32 +0000 Received: by mail-lf1-f48.google.com with SMTP id t25so18880379lfg.7 for ; Mon, 27 Jun 2022 14:47:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudera.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=13/wlrFmaA0HQ5p7pWlybCad8a5Qp02TWLDgsnmmj50=; b=llt8rV6eSSNwLIzHMHF7djzpgC6kwlMQlzNP+14AjKcVxnoO2EfoK9l3MNpiOv0CX6 HKzyIoAmDyvhxlsa7RjQlsw+KPPTDbyYxeCwwJ6DbHcDa3aZf8wFh/MNxbf496ByPntQ wpyQCUO3mb3ImfvOuPNjiPq5fhZMJLuFW9s5PM1lNApyAqotH+uLpDeIPXjZhAePKTeJ nVrWgPNk3Bg5Y4xfAOizVulVRAkKB502tVeV0cMA45UNCMhrbL77zEGY3gEiRszRc0Qx Y32Xd/QxHCUZCd127oZBNsaDkZvonV6kWWZCOUjRENG5BHiCOyLi1IDBtkt9NiVe8y6j CSbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=13/wlrFmaA0HQ5p7pWlybCad8a5Qp02TWLDgsnmmj50=; b=4DjD2ClBu/rMo14ZNEl5nQHtdpo4QZWcQdBjM2fVobfNYf4lAU0RLtXvF5kIro5tgP FHRA+JFxW1Ynqf1cX8ZT8s2/RDAghkS6Sn1CtZXwY4e9AUxUdYpqBpMs8uFpA0BHCein PdOGa6mTZo3FRZq7LKEtWxKixJGbRRZa/6zp8kqOrXDqlCIr7/PwMs5Q5K+30zWvuEs4 Fy8f76lOMuuyIv4Sb0vwB101XnaZuBnOVxtOw9YFIwq55GmDHBYG37RR9ya6MIH/FQYm ERppHKex7raCsWkWKNaFjCFCbaXz8RZqidJQyEltQ9Nk5SGp5xCeiiWtkS2F5fewXIBN unVA== X-Gm-Message-State: AJIora9txsAiVglo2BvRyEoH5HF9W74kIy1zVhoFsDc8faAweXuX7LEF ZYUZdFCES/LSFcisJ4UNxPaYGxSuLrt5NdNk71nFUg== X-Google-Smtp-Source: AGRyM1tyLF6WLM1bffMGHXAUj2eCbt97Lk15cJgUD4+GGKDBymWU1QbyO1sMicM1iP+RcVXrv8k0kRJq0o/kpWrRI64= X-Received: by 2002:a05:6512:7b:b0:47f:6568:a143 with SMTP id i27-20020a056512007b00b0047f6568a143mr9995177lfo.485.1656366451404; Mon, 27 Jun 2022 14:47:31 -0700 (PDT) MIME-Version: 1.0 References: <3accd9cb-aede-41ce-96e6-f3e175392b9d@www.fastmail.com> In-Reply-To: <3accd9cb-aede-41ce-96e6-f3e175392b9d@www.fastmail.com> From: Michael Smith Date: Mon, 27 Jun 2022 14:46:55 -0700 Message-ID: Subject: Re: Bug: 'export FOO' not idempotent To: =?UTF-8?Q?Lawrence_Vel=C3=A1zquez?= Cc: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="000000000000f4bb9b05e274dde2" X-Seq: 50389 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --000000000000f4bb9b05e274dde2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks for responding! I searched a bit but hadn't made that connection. I can work with that. On Mon, Jun 27, 2022 at 2:44 PM Lawrence Vel=C3=A1zquez wr= ote: > On Mon, Jun 27, 2022, at 5:11 PM, Michael Smith wrote: > > Environments tested: > > - macOS 12.4, M1 chip, zsh 5.8.1 (x86_64-apple-darwin21.0) > > - Ubuntu 20.04.4, zsh 5.8 (x86_64-ubuntu-linux-gnu) > > > > If I repeat 'export FOO' to mark an environment variable not give it a > > value, in bash it consistently does not show up in 'env': > > $ export FOO > > > > $ env | grep FOO > > > > $ export FOO > > > > $ env | grep FOO > > > > > > but in zsh the 2nd invocation will set it to an empty string: > > $ export FOO > > > > $ env | grep FOO > > > > $ export FOO > > $ env | grep FOO > > > > FOO=3D > > This was discussed in workers/47531 and the ensuing thread. > > https://www.zsh.org/mla/workers/2020/msg01350.html > > It was resolved in zsh 5.9 with the introduction of the TYPESET_TO_UNSET > option, but as per workers/47545, "[t]his is a long standing feature > of zsh, so the default behaviour is not going to change." > > https://www.zsh.org/mla/workers/2020/msg01364.html > > > > This is an issue only because a project I'm building uses an empty > > export for documentation, and it makes that project annoying to work > > with. > > Depending on a variable to be exported but unset is a curious design > decision to say the least. > > -- > vq > --000000000000f4bb9b05e274dde2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks for responding! I searched a bit but hadn't mad= e that connection. I can work with that.

On Mon, Jun 27, 2022 at 2:44 PM Law= rence Vel=C3=A1zquez <larryv@zsh.org> wrote:
On= Mon, Jun 27, 2022, at 5:11 PM, Michael Smith wrote:
> Environments tested:
> - macOS 12.4, M1 chip, zsh 5.8.1 (x86_64-apple-darwin21.0)
> - Ubuntu 20.04.4, zsh 5.8 (x86_64-ubuntu-linux-gnu)
>
> If I repeat 'export FOO' to mark an environment variable not g= ive it a
> value, in bash it consistently does not show up in 'env':
> $ export FOO
>
> $ env | grep FOO
>
> $ export FOO
>
> $ env | grep FOO
>
>
> but in zsh the 2nd invocation will set it to an empty string:
> $ export FOO
>
> $ env | grep FOO
>
> $ export FOO=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $ env | grep FOO
>
> FOO=3D

This was discussed in workers/47531 and the ensuing thread.

https://www.zsh.org/mla/workers/2020/msg01350.html=

It was resolved in zsh 5.9 with the introduction of the TYPESET_TO_UNSET option, but as per workers/47545, "[t]his is a long standing feature of zsh, so the default behaviour is not going to change."

https://www.zsh.org/mla/workers/2020/msg01364.html=


> This is an issue only because a project I'm building uses an empty=
> export for documentation, and it makes that project annoying to work <= br> > with.

Depending on a variable to be exported but unset is a curious design
decision to say the least.

--
vq
--000000000000f4bb9b05e274dde2--