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=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,RDNS_NONE,UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.4 Received: from authenticated user by zero.zsh.org with local id 1kiMxS-0004zF-8v; Thu, 26 Nov 2020 19:29:34 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wr1-f45.google.com) smtp.remote-ip=209.85.221.45; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-wr1-f45.google.com ([209.85.221.45]:36190) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kiMx8-0004kS-UP; Thu, 26 Nov 2020 19:29:15 +0000 Received: by mail-wr1-f45.google.com with SMTP id z7so3305472wrn.3; Thu, 26 Nov 2020 11:29:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2cwlUDovxOQ3Z2lVjJcCw9Rg3vEhk6SaY+La/zP6Zi4=; b=fJQ51FwzT4l2RDMF5SKrYngR8y4v6OHO7N/S/VyPmEooD3dCxXopwxS8tDrEC7/n1U AtuE+cgbqWnz8WqnbS5EZLC8VGRmhseVd9RDqNiy38APJU3bJUWR6Q/9243SDw4CBhJY G5rshP7jCOQoIBlaywFvyBaDBRB8kEl2f5kl6S2BTV8h31ZoSM8exBu2txGKrG4xcu25 dN8ZEltj5AvbimW7KjDXRn9jHshnrBrizrxLkpEL/1pqrEEqQuDOpawHGcIPjhK9XB/C V71yy6My473nAWhaLLuB5AXU6E+G9FJE4QS+nQkODndlW1IhzJlDVkuPuaoK1XXr9Psp 4ayg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2cwlUDovxOQ3Z2lVjJcCw9Rg3vEhk6SaY+La/zP6Zi4=; b=lVbpo4/S4vCg05Ou22/yi5/TuCk0L5hLfdifaRx+2EUdo0ok+QWChk11GnHzP6nD+D szoLktCRuOnTfmvenBuhwEiPgoJGhZ861mPyRUd6ywL2nibQmwNS/4PHEJ8J0dU6ruSD p6gLYVioBV43XjScPV13CP82yAVd7sFAuuEszYmRn9HoAWQZaOeBHmFMc+mMB6SfbNZx Y/cUO98r1oRHpGgfqSc47WZfSyx9UZXxjiPL3Z8f4IwH/A4fKsFnngL9i9NnR/8KkDo4 gQCbWflYeR0Ijs6nQq3qC2UCCybLDsVbuFyfzUmLwfKbfOBERwLkUha8LhTShX1ORBM1 F4zQ== X-Gm-Message-State: AOAM532eX2YbPRWhRALPwf6cJDHtGIgLnvWKybxLwuxhj3SPUAnijaCI dDefLMvX/yMkPuqxrRHfY27iM1DQWc3N/+HQw0HuML0eywiPiA== X-Google-Smtp-Source: ABdhPJx2NZypXfEuL2dJ6DB5j4H8HB3gvB5yJQJPZBU6W94nniQz1Ro1GSefmElitSVQmnVMT6GlurCHTBZYN3NajB8= X-Received: by 2002:a5d:4349:: with SMTP id u9mr5563659wrr.319.1606418954373; Thu, 26 Nov 2020 11:29:14 -0800 (PST) MIME-Version: 1.0 References: <20201125131921.vay7h3xk5qn4odgg@chazelas.org> <20201126061029.in5tpnrg5bplam5k@chazelas.org> <86243-1606389706.499549@-gQx.nNYG.4Z3k> In-Reply-To: <86243-1606389706.499549@-gQx.nNYG.4Z3k> From: Felipe Contreras Date: Thu, 26 Nov 2020 13:29:03 -0600 Message-ID: Subject: Re: More rabbit-holes with unset variables To: Oliver Kiddle Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 47641 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: Archived-At: On Thu, Nov 26, 2020 at 5:21 AM Oliver Kiddle wrote: > It appears that export VAR will not export an empty VAR even in zsh > (unless you do VAR=""). So zsh's not exactly consistent. > typeset [-x] is arguably just a variant of export. That is a good point. Why does zsh return nil in this case? typeset -x FOO sh -c 'echo ${FOO-nil}' > Felipe Contreras wrote: > > The discussion is about what "typeset var" (with no type) should do. > > That is not "with no type", it has the default type which effectively is > a string. Other shells also treat such variables as an empty string for > the purposes of other features. Try += for example. I mean the user specified no type. What each shell implementation decides to do with that depends, but the user specified no type. Yes, it makes sense to use string as the default type, but some weird shell implementation might decide not to. Cheers. -- Felipe Contreras