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,FREEMAIL_FROM,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 13605 invoked from network); 23 Aug 2022 05:47:37 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Aug 2022 05:47:37 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1661233658; b=akmTxG6v+1si7rzWjJdsIdpms5of1pM4ULb6jltIaOvw7r8i31teVsJHXDVp1Q7PIjark582FA 1s8lHyMzhtbOupcCKwUq67nzURczlN5gxSv3X/tJg2VlPnVBQzRmQRjiHI1ySumSHWkC/D82Zi FuvB+LxiWNsr8TYZyEnnZT2p6XkpH2QuS3PLsmoLpxTfKT98dQqlCNzAmD5VISi5pH7oz52OW0 sNLTs1Iv4wlq+UDewgQBClEpdhTG4rzLBs16pb9CQ9wBVYr2OtiAKOs7SizFBPsHVLirKpKtBZ U0K0QZwFalIdF4w0pPBTOTkBrB44/u4rb70ZwjPHiwYm+g==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-vs1-f44.google.com) smtp.remote-ip=209.85.217.44; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1661233658; bh=t1dPOX6MIU8hPHyO46vLjyTZ2b+rAziQM56rXbHDPG4=; 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=IUxEnWXYvIR4SsCuyeSXvChW7186dG7DSg1IqY0uD4SvmatX25iyGdFcRpGGyDeJJqxMBwFZGx 91SB0Sx+2IVeVIUt6DctTdqSs7+CS7Yc98p1YIbbHMu4Dqye3xNd7nVyp1LKPdnuRBllm8kO9D jNKNqGDgjfeS8KqN1/PBVNQg+gEkua2QyUvhYi6b0nLW31mB2Nn55/cv6yhYXQAwhALx8g+m4w H0q2hrvb8bgwHaf8KkwimBPVMNXY4qdEQEWR6xST5GJse4V/biY6hyYlZeui+jgkHtE8h0UhnJ Y1RMJHn4tYsJyioN96CV+lrOpuGxlYqHVIcwFeypAc7g7Q==; 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=r8TUxuSUZ/RqdkAy529ZBzj0wreD4uFvcSFQGXQiezs=; b=prfbdFEGUBoDb1c/c0NjpwLMjz LLwTfFdWrCXSSQ9q9Cjsos1q/yJdZW91nepF5DO1iUxhsmbib21rGbWjQgLF0U9sPpBYMyWavAE8h pxd+NWeo93LvRjGJLpXYMlyfYp6HfXZiSbJjMRkVk7huAyuIRAJzdeQ5RnvC459gCwMm855mEcL/a S/cpB9gzKwv5V0FXo2V92ZwUN0xpBnqkka9o5060vGlpOg1JhhhJIiIKBoYgUz5GKruly3LPrxRQR 6WVXkxOHacRUyAJnRqPo0xOf7rNSVrV4n0NuQ+Dm7Dx78pU+JfGwUJBouuk6OgQ+mzUG+j1GcOJKy nP/CRVBg==; Received: from authenticated user by zero.zsh.org with local id 1oQMlE-0004iV-IQ; Tue, 23 Aug 2022 05:47:36 +0000 Authentication-Results: zsh.org; iprev=pass (mail-vs1-f44.google.com) smtp.remote-ip=209.85.217.44; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-vs1-f44.google.com ([209.85.217.44]:33739) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oQMg5-0004Gh-Uw; Tue, 23 Aug 2022 05:42:18 +0000 Received: by mail-vs1-f44.google.com with SMTP id l7so13162814vsc.0 for ; Mon, 22 Aug 2022 22:42:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=r8TUxuSUZ/RqdkAy529ZBzj0wreD4uFvcSFQGXQiezs=; b=inXEtAI8c/5yfnGLr7YIdn239NsbnZMwg7IwUXu57eB+ZsPopclMr1w08PBtGn12zd K83mrbhCjeYK+7HRplS2562LhYhZq41lBo8E0KLhdzcXCNC6a3i8+yVAnZalnxtmxUv1 FXVdsV1O7v0ijTzVZrNOGNTlmx9zrkGKUz2UAuxh4cAeJmz4Bd/ug7w0yypWT3pheMoB dSP2HoN7iUtofCUY9TMVpQPItFi0pdWQdKk7jt9624nmSeMLGeeH2mN53R1HWKN8Kn2S sD2CELLYC/WK3v1Ks3DcCBuPQNJmw1CeexwJA12OwW3gfV3MoJFaE6t8EU2dxHy1StM/ Pcvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=r8TUxuSUZ/RqdkAy529ZBzj0wreD4uFvcSFQGXQiezs=; b=EC+W7RaqVv5EGCpFjlyqn01e6uhBSBzp/WKRqnNCUkd9I1hS2eIQwk9Z8021sgpay8 lXupZPIOCo4wLdHDh4uogsCMs/yIGbzOFFqJ24j0dGfPPGj2ejBWb7YzdL5Xz+cj/3os o13dvl8zahNjDERojQZQC+rmer5x9CiOAcCpy6JzXs2Nzt+EDUUTj71qUCUfk5z85WoB i9zAGEZfa14V4t4CGPAtWkoD/DU/eThjPy7gz7D3+YvrPaTihQK6yv7nbY4U4Ur25swc u3IJG9E6KExyBtPzFLft2BmdlIEw/Rs3DCeVghjrMLINOkTry1UL/fXUJXRROZfNQc5f q9zA== X-Gm-Message-State: ACgBeo2nqTqPacKvqN93EWvVwqTliBsDaUEl1VQr02LjS6HOD5J6swvb ryQsX+LAz9Iq1DZb0MpjzqRp6aiibKi6f14YqtuJeFsr X-Google-Smtp-Source: AA6agR7L06oitjyVCjhIfIhkb4vIV0Wr4VUCxYgTO8SH9qx/PtjU2aD67S4tjx+6t2uKSMeCEeaVS94KbsQezydXCks= X-Received: by 2002:a05:6102:5591:b0:38a:9691:933f with SMTP id dc17-20020a056102559100b0038a9691933fmr8011581vsb.54.1661233336446; Mon, 22 Aug 2022 22:42:16 -0700 (PDT) MIME-Version: 1.0 References: <605183ae-f347-4f64-bf99-e89f98b6637e@www.fastmail.com> In-Reply-To: From: Liu Xin Date: Mon, 22 Aug 2022 22:42:05 -0700 Message-ID: Subject: Re: An incompatible behavior from bash? To: Bart Schaefer Cc: zsh-workers@zsh.org Content-Type: multipart/alternative; boundary="000000000000e873b505e6e20641" X-Seq: 50498 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: --000000000000e873b505e6e20641 Content-Type: text/plain; charset="UTF-8" Ok, thanks for the clarification. On Mon, Aug 22, 2022 at 2:44 PM Bart Schaefer wrote: > On Mon, Aug 22, 2022 at 1:00 AM Liu Xin wrote: > > > > I hold the wrong impression that zsh is compatible with bash. I just > assume it because I see both Ubuntu and MacOS have replaced bash with it. > > Zsh is mostly compatible with POSIX shell provided that it is invoked > via the name "sh" (e.g., when linked to /bin/sh). Bash is similarly > compatible with POSIX when run this way. When run under their own > names, zsh and bash differ from POSIX in different ways. > > Apple and Ubuntu appear to have concluded that zsh's POSIX > compatibility is sufficient to use it as "sh". I won't speculate on > other motivations. > --000000000000e873b505e6e20641 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ok, thanks for the clarification.

On Mon, Aug 22, 2022= at 2:44 PM Bart Schaefer <= schaefer@brasslantern.com> wrote:
On Mon, Aug 22, 2022 at 1:00 AM Liu Xin <navy.xliu@gmail.com&= gt; wrote:
>
> I hold the wrong impression that zsh is compatible with bash. I just a= ssume it because I see both Ubuntu and MacOS have replaced bash with it.
Zsh is mostly compatible with POSIX shell provided that it is invoked
via the name "sh" (e.g., when linked to /bin/sh).=C2=A0 Bash is s= imilarly
compatible with POSIX when run this way.=C2=A0 When run under their own
names, zsh and bash differ from POSIX in different ways.

Apple and Ubuntu appear to have concluded that zsh's POSIX
compatibility is sufficient to use it as "sh".=C2=A0 I won't = speculate on
other motivations.
--000000000000e873b505e6e20641--