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.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 15311 invoked from network); 4 Jan 2023 04:17:25 -0000 Received: from minnie.tuhs.org (50.116.15.146) by inbox.vuxu.org with ESMTPUTF8; 4 Jan 2023 04:17:25 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 523F84254A; Wed, 4 Jan 2023 14:17:20 +1000 (AEST) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by minnie.tuhs.org (Postfix) with ESMTPS id 6A28A4251D for ; Wed, 4 Jan 2023 14:17:15 +1000 (AEST) Received: by mail-pj1-f42.google.com with SMTP id c8-20020a17090a4d0800b00225c3614161so30674844pjg.5 for ; Tue, 03 Jan 2023 20:17:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iitbombay-org.20210112.gappssmtp.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=P8r42LWai9xiodsVTPszbG8OflHTz6+JZ3mlm5r1GTQ=; b=ooFNyxzTXgXKljPHxeDoetsSloUrWi5RexjEE+FVhLg9znD4a9AO8zMlyXx+tBNp6X k7CVAhcSqYCa4d8vU+M/9+XKa/FxkFhQoN0sN0McevAr9grYCl8P3ycsSltC94awgsVm LnScQdban9dAGwNPUSk+63dhuTB2ZyjOIRSkCpi0M9lC+qV0Yy+HvPjORg15sUFgo0pd 6BZ8F/grlubkgmXrPpeov1gtxZ4BjMmAYEGYixmsfdw0BV8pJPHPwU4Ccz9QvtKt7ien SjbI6kgcxQ1N7dyP1+3UUnJ89wf+D7G3VJf4Wc1UW/MEEtW60n3sXFzbvLfC2ORRW0H4 o4vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P8r42LWai9xiodsVTPszbG8OflHTz6+JZ3mlm5r1GTQ=; b=XtJbZcB9SX/eVqiS9K2z/fQgzUuPPPH3jclGTKrzY+qi/xeHXvEOAtYZHpA884Px0q 5IPBOXv3d7rKR6Je4OStXz7bQgaxSXUJCvykiAKnfIklp2KNL2DhCYWS5rFodMlPxPBv 7qvetB7KAZ4PxCm6zjQqbL7dMcbhVm9Q7sH08PhZBFLLutWn1RdWnbmdp1xz8T4bK7QJ iC5X/0n30QkS3MXX0V5nxuHWfZmNT08EvHpKjHMgZLS4tbs6osN5F/DOmfeVSyYolwwT usAMjiyfY3VZqJR/CFEda/r7wDTlAycofNAKsGv24Nm11A3uceW9Z8ZDFATlRT7qozBD 2zng== X-Gm-Message-State: AFqh2koLQhx9D11w2OjG2wnhBYbWsCCa7DE9Gd+TwfRSXhIuQvXr2Rcs o4PhmcqoxKzC4pFVxak6hErvlQ== X-Google-Smtp-Source: AMrXdXsRvSuXODW6bR0BZD05x/Ge7vqINmazkXxQur4iDZ5FHwpibCK8RlgRpY8Qqy5q+iCmeX1dzg== X-Received: by 2002:a17:902:f60b:b0:189:e924:e279 with SMTP id n11-20020a170902f60b00b00189e924e279mr53108649plg.49.1672805774911; Tue, 03 Jan 2023 20:16:14 -0800 (PST) Received: from smtpclient.apple (107-215-223-229.lightspeed.sntcca.sbcglobal.net. [107.215.223.229]) by smtp.gmail.com with ESMTPSA id q7-20020a170902a3c700b001894dc5fdf2sm22834390plb.296.2023.01.03.20.16.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2023 20:16:14 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) From: Bakul Shah In-Reply-To: Date: Tue, 3 Jan 2023 20:16:03 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <52FB6638-AEFF-4A4F-8C2E-32089D577BA0@planet.nl> <464819f0-d2f6-2a60-6481-a194f4428b4d@case.edu> <20221230200246.GW5825@mcvoy.com> <88f83b4c-b3f9-ed87-b2fa-560fb369742a@makerlisp.com> <20221231035931.GG5825@mcvoy.com> <528f0c53-ccc2-88a1-5a7b-120362c648dd@mhorton.net> <20230102165120.GK25547@mcvoy.com> <20230102174304.GM25547@mcvoy.com> To: Dan Cross X-Mailer: Apple Mail (2.3731.300.101.1.3) Message-ID-Hash: BL5SDZVGGDQ2W2CMAPWTF3XRVWWWS3ER X-Message-ID-Hash: BL5SDZVGGDQ2W2CMAPWTF3XRVWWWS3ER X-MailFrom: bakul@iitbombay.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-tuhs.tuhs.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: The Eunuchs Hysterical Society X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: A few comments on porting the Bourne shell List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Jan 3, 2023, at 7:31 PM, Dan Cross wrote: >=20 > On Tue, Jan 3, 2023 at 10:22 PM John Cowan wrote: >> Making shell scripts portable means not using pipelines, because = given "foo | bar", kshNN and zsh execute foo in a subshell and bar in = the top-level shell, whereas in other shells, both foo and bar execute = in subshells. (For this reason, Posix allows either behavior.) Not = having pipelines is a pretty drastic limitation. >=20 > This came up at work just the other day: >=20 > echo ' hi ' | sed 's/^ *//;s/ *$//' | read bummer > echo $bummer >=20 > The behavior varies between ksh, zsh, bash, sh. Yay. On this example sh, zsh, bash behave the same way on freebsd. Rather than ban |, I think the lesson is to *avoid* builtin commands in a pipeline that can affect shell's environment. I only write /bin/sh scripts in any case. It is really unfortunate that infix | is so beguiling! Except for that a Lisp or Scheme based shell would've been fine and dandy! :-)/2