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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9955 invoked from network); 11 Nov 2020 18:36:52 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 11 Nov 2020 18:36:52 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1605119812; b=EKZ7wTirq/fqpgk+V6KvUepNLC1ypT8PCDJNsSvCe7d9kD33xEGZ3Bh4dQNbeRoWtO859GkCgP SMHs6nKOTMDiP4/0ZgQoZPF+Z87SQ8A87yXTkK33lkqickm8YZzSN9lpP8CEBxo2qUmpup7sLS MR8e7DERr/0XVXNTSq5XAv7hXk1RBKWn+9YyTd5n6FoojqqRiiT0hI25cyqYQ43nh7sGHyFSGW qnvBgio9JGrrrnVIJz7h55MC7IwqS2V6lGdFRFWpkh/GCpp4G6EyXewkRmce8OlV9HYqadCxHQ KvmPF+wUb9pblk0jxzbJBWNOj+BwKPh1d5vofQm14iC2tg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oi1-f178.google.com) smtp.remote-ip=209.85.167.178; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1605119812; bh=gR+SN85C1i/qD4caxyNEz3dRDNdJE7NXr12clMGxEhI=; 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=nE/BVCMdojkPXv8XquN024a8vysbGTZPWOlgkyOd21KG/Hm2PdFcAWGRLmhRETuKgmUzj5f74S RwbjQZ1mMG4OKsnBRf10ggtSZYdpLRts38PK/rnAH8R368aD4i/VrgrCFf1yhJA22ENZ/ImBlk 1oqQ1Fzg/9iiBkomqeWAPktd1Wb8g0HRRCTuCtoaoPhHbzxx/HSsqh6z+lz40Myad6pFcqamhI 01abX2cT/8l/aKKaH/Ef6YPHD41c6EJcm2fk71ExLda9h9KwnF65Vzqw8VSgrzcbProT9FF2Gj sRkkggoH39+K947ewt8HxMDBwlqwT9hZN/R9iQInHXsBBA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; 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=lNZLGRueFIi1Sj4fz3kB1YwZDstoAw2ekvqruv7QY3o=; b=pktEnmiv3NM89m8l/td0l6BMcL ly95y/qdr+sMhqtxbYm+sK+nAG+6hV1m/JSFEZFPMEMRY9V0fKZ5Sl+LcpdGUAr7pqawL+nNQxPIw DAd/uqh+CHKSuvbCTKgsjnZTlh+KwVIDycmPZX8RimAHs4AfriZxIogHsL0a8eKHPrhBPXyMlMk+A 1azNuCFMGtm69a61IQlfXLsnL8+5+S8dPf2NjKCQ8Wtqgsc3cG50ClE1TQuzP2YZoRy+mX1LYy1OA uNz4M8Zwf0x+RDkYQm12kepMCAalitGIxWFdpIWM6/3CSS64LM3TqxApRX+Fu+gRp4wK4XwtKhydb iiu9MJfA==; Received: from authenticated user by zero.zsh.org with local id 1kcuzC-0005H7-46; Wed, 11 Nov 2020 18:36:50 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oi1-f178.google.com) smtp.remote-ip=209.85.167.178; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-oi1-f178.google.com ([209.85.167.178]:42405) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kcuyu-00057d-5z; Wed, 11 Nov 2020 18:36:33 +0000 Received: by mail-oi1-f178.google.com with SMTP id w145so3266120oie.9 for ; Wed, 11 Nov 2020 10:36:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lNZLGRueFIi1Sj4fz3kB1YwZDstoAw2ekvqruv7QY3o=; b=HI+oRzY8aXyOuTMlY6edYCVvaeuLuCqhzLbx54ToOJAMF++Q+LtIKUOcMzatGKbXFD SLhGqHi1kYVpjdOvjhbbbrow8kiN+Z06LBnJ1A0iIwZd1MMGGwVRfzyKYmBgK+Ge18gz ffwjgFBGW4BSDOSXLOQcuqoYmyP3pMnfnA8f6VThAoAicrpQUIFQL2LHQH/qIxBCGcAo 1nbHg99cmoLYoX27TI1Ul78+esu66HYoeuFVij8Jd9W5TyaOnOkO2Ta9uAzb1SjExyjo x3IVQbaxW8/nyUURc6WrXbh+tUFWt0Zj0zsxbwbJ9xqh6I+noQlw1H6JMYH20DJecXAE 5Iwg== 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=lNZLGRueFIi1Sj4fz3kB1YwZDstoAw2ekvqruv7QY3o=; b=Hoxz+9EaL63j2Plkm02B8XuYIoaZLotsyUeqYbHhQwERhSw15KI59bAHHD7MV7O48L Z9aZ0kEvz/GiWtMcgEQ26BC6K8j5ReUZnxryBTyNwAaguGP+sYekcDuz7ossCWyKNmkX RjZ5rutreKFuKeqGySHdHh7DZSm+ZkvqVM2V30OKIBkYKVHoH9RLN4Q8H1Uu2hNx7YXi Ga1zb87HKvf6PKrkq3nKA5eoyMlBcAu1Hb5TbTu6GFjDTW8Yc5gzyGKWNTahR+v4/xnF CwgDTde2s0E1enk8u1axVDGnK5bur+ytHiDKyGKUFi6fHTbXk8BLr/557qxbM9CKZqew 5POQ== X-Gm-Message-State: AOAM532mP8uY4SMGzITlRNtyguWn1wQkLaLO+oyH/y0aQk8VvDCe2v8Z gJPqtqkYRc3ecG+LlnvljbR1ZL5veh98+DoRDTtBUQ== X-Google-Smtp-Source: ABdhPJy3vQYrNTC19yLl2AQmwJ6/pIS+KD+dyUjtBPNMw4IV7JPjOEoB4uAPY/35gqEMG8NgqSF7ll4lmkG0k6iurPc= X-Received: by 2002:aca:4d06:: with SMTP id a6mr2936110oib.84.1605119790777; Wed, 11 Nov 2020 10:36:30 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Wed, 11 Nov 2020 10:36:19 -0800 Message-ID: Subject: Re: Bug with unset variables To: Felipe Contreras Cc: Roman Perepelitsa , Zsh hackers list Content-Type: multipart/alternative; boundary="000000000000f39ade05b3d912be" X-Seq: 47539 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: --000000000000f39ade05b3d912be Content-Type: text/plain; charset="UTF-8" On Wed, Nov 11, 2020 at 10:04 AM Felipe Contreras < felipe.contreras@gmail.com> wrote: > > And what is the reason why this is not the default? > Remember that doc Daniel quoted? 30 years-ish ago, when implementing zsh as a new shell from scratch, that documentation was used to decide the behavior. At that point the other shells that supported "typeset" were not freeware -- they required expensive licenses or were bundled with commercial operating systems. So the implementation followed the doc (sometimes, it followed a misunderstanding of the doc, which is why for example zsh syntax to specify integer bases differs from ksh) without examples to which to compare. Zsh development has always followed a principle of NOT arbitrarily breaking past usage without an extremely good reason (something I wish other APIs would have taken to heart over the years ... IMO there would be much less abandonware sitting in metaphorical dustbins ... but I digress). So by the time anyone noticed, the behavior you see now was standard practice for zsh in its default modes. Your original example can use ${var:-other} if empty string has no explicit meaning in context. Either way, if "emulate ksh" is supposed to emulate ksh, then it's not > working properly in this instance. > Despite the name, "emulate ksh" is not supposed to perfectly emulate ksh. All it does is change the values of "setopt" to match ksh as closely as possible. A more complete emulation is achieved by actually starting zsh from a symlink named "ksh" (or one of a few equivalent ways). Same goes for "sh" and "bash" (although there is little difference for those two). --000000000000f39ade05b3d912be Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Wed, Nov 11, 2020 at 10:04 AM Felipe C= ontreras <felipe.contreras= @gmail.com> wrote:

And what is the reason why this is not the default?
Remember that doc Daniel quoted?

30 y= ears-ish ago, when implementing zsh as a new shell from scratch, that docum= entation was used to decide the behavior.=C2=A0 At that point the other she= lls that supported "typeset" were not freeware -- they required e= xpensive licenses or were bundled with commercial operating systems.=C2=A0 = So the implementation followed the doc (sometimes, it followed a misunderst= anding of the doc, which is why for example zsh syntax to specify integer b= ases differs from ksh) without examples to which to compare.
=
Zsh development has always followed a principle of NOT arbit= rarily breaking past usage without an extremely good reason (something I wi= sh other APIs would have taken to heart over the years ... IMO there would = be much less abandonware sitting in metaphorical dustbins ... but I digress= ).=C2=A0 So by the time anyone noticed, the behavior you see now was standa= rd practice for zsh in its default modes.

Your ori= ginal example can use ${var:-other} if empty string has no explicit meaning= in context.

Either way, if "emulate ksh" is supposed to emulate ksh, then it&= #39;s not
working properly in this instance.

Despite t= he name, "emulate ksh" is not supposed to perfectly emulate ksh.= =C2=A0 All it does is change the values of "setopt" to match ksh = as closely as possible.=C2=A0 A more complete emulation is achieved by actu= ally starting zsh from a symlink named "ksh" (or one of a few equ= ivalent ways).=C2=A0 Same goes for "sh" and "bash" (alt= hough there is little difference for those two).

--000000000000f39ade05b3d912be--