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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10326 invoked from network); 4 Dec 2020 13:23:27 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 4 Dec 2020 13:23:27 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 0289C9CA67; Fri, 4 Dec 2020 23:23:26 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 6A0349CA4F; Fri, 4 Dec 2020 23:23:12 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="sOPAvbqG"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 6E6319CA4F; Fri, 4 Dec 2020 23:23:10 +1000 (AEST) Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by minnie.tuhs.org (Postfix) with ESMTPS id A0BA79CA4B for ; Fri, 4 Dec 2020 23:23:09 +1000 (AEST) Received: by mail-lf1-f53.google.com with SMTP id q13so7596311lfr.10 for ; Fri, 04 Dec 2020 05:23:09 -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=aKGgrKiqYDkt5YfOTveWD2YFPyKRx1AWLrf9kXT/nI0=; b=sOPAvbqGJPlCUU5Im2UjpaBFadfHzzYSbx/ZZiBADv0r+r2GisF0Al0MxTKWaC8ApY ZRR6yWTWui5W1BPNff32+tcaWLc0jGzbczGpq9po0eMMvIqA9yabosiYUsIcmxK0kbfq QzRk4zmYKeIUEAAXQWTU9aA28UvbRfTPuTcVfPWUaVhl3KIGWdR/43cMUGLwBy261uaX E/nvy9q5NGiGrLTOJRVDtAw3+Wf6k+kGYjDC6yDsjQEgDG6NQ3EMORPjbVtz7O9jedr0 n3nCChqJYTmus/EcIDsACuRlQsXmdqRkvarTjGxKQRnjbA7XToXKPHv0b2++JTYCbfyR 0how== 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=aKGgrKiqYDkt5YfOTveWD2YFPyKRx1AWLrf9kXT/nI0=; b=WPlZPcDZw8hvoFkJKk1pTmD0KQ5lWCtsDcg2OvNpt0JWjNVifvrW9bZIuKn4BHhJAk t6doh+/q9FDW51H3Ow02C+8C6Nt7CmFQgNLl+7InYy2uOxhLae3OrpiARL7vJdBHdVIZ Y5U2kYOnhF80p3QVaUUTRuycrIqUs8gM7LF59TOcL3yLTOcTtkkGL3JJahnRo8d2/VPx 1qK8Gldv70a5aKnGq4mree5fe7BgnhYqTwpz/LH7NZ43UnU3fOPA1DcxtsoL0vv6jr7+ DKbldxOhmUpw04wfJvr2Yi4/0pjFWx7zqjwM5c8WIs+myKU/cTpXp3svg9RjQCtgObUP 42iQ== X-Gm-Message-State: AOAM532YN6VV1hb3b5b/04uPETkJSmtgoUIt6j7OrcFm5ommTiNS9Ig4 BHgAQjKE+7QMUI5lPgTkZk876yT2Cav1V29W7Q== X-Google-Smtp-Source: ABdhPJxkUDQ4AiYH2aJvutfAHyzLZ5gFEnrLu/S0xSL/8qmB2u4/ZIZ6z8G07zZyRrk4j9K+ienDGpZqMsSKPOdUTUk= X-Received: by 2002:a05:6512:2103:: with SMTP id q3mr3269922lfr.11.1607088187922; Fri, 04 Dec 2020 05:23:07 -0800 (PST) MIME-Version: 1.0 References: <20201203204301.GW19746@mcvoy.com> <202012040927.0B49Rkx6019895@freefriends.org> In-Reply-To: From: Tyler Adams Date: Fri, 4 Dec 2020 15:22:56 +0200 Message-ID: To: Niklas Karlsson Content-Type: multipart/alternative; boundary="000000000000905dc305b5a36014" Subject: Re: [TUHS] The UNIX Command Language (1976) X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --000000000000905dc305b5a36014 Content-Type: text/plain; charset="UTF-8" Not always $ cat a | while read line; do echo $line; done #!/usr/bin/env bash PUPPETEER_PRODUCT=firefox npm install -g md-to-pdf $ < a while read line; do echo $line; done -bash: syntax error near unexpected token `do' Tyler On Fri, Dec 4, 2020 at 3:17 PM Niklas Karlsson wrote: > < file grep foo works. > > Niklas > > Den fre 4 dec. 2020 kl 14:16 skrev Tyler Adams : > >> I find cat file | grep foo simpler because it reads Left to Right. >> >> Tyler >> >> >> On Fri, Dec 4, 2020 at 1:34 PM Andy Kosela >> wrote: >> >>> On 12/4/20, arnold@skeeve.com wrote: >>> > Dan Cross wrote: >>> > >>> >> This has always struck me as particularly elegant in scripts. >>> Consider: >>> >> >>> >> cat "$@" | whatever >>> >> >>> >> (Or you may prefer `cat $* | whatever`) >>> >> >>> >> Now one's script can take any number of file arguments or stdin, even >>> if >>> >> the filter does not. >>> > >>> > I think Dan has hit the heart of the matter. People are used to using >>> > cat for multiple files to start pumping data down a pipeline, so they >>> > continue to do so even when there's only one file. >>> > >>> >>> The classic example is: >>> >>> $ cat file | grep foo >>> >>> instead of the simpler: >>> >>> $ grep foo file >>> >>> It appears cat(1) and pipe(7) are deeply ingrained in people's brains. >>> >>> --Andy >>> >> --000000000000905dc305b5a36014 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Not always

$ cat a | while r= ead line; do echo $line; done
#!/usr/bin/env bash

PUPPETEER_PRO= DUCT=3Dfirefox npm install -g md-to-pdf

$ < a whi= le read line; do echo $line; done
-bash: syntax error near unexpe= cted token `do'


= =C2=A0Tyler


On Fri, Dec 4, 2020 at 3:17 PM Nikla= s Karlsson <nikke.karlsson@g= mail.com> wrote:
< file grep foo works.

Niklas

Den fre 4 dec. 2020 kl 14:16 skrev Tyler Adams <coppero1237@gmail.= com>:
I find cat file | grep foo simpler because it reads Left= to Right.

=C2=A0Tyler
=


On Fri, Dec 4, 2020 at 1:34 PM Andy Kosela <akosela@andykosela.com&= gt; wrote:
On 12= /4/20, arnold@skeeve= .com <arnold@= skeeve.com> wrote:
> Dan Cross <cr= ossd@gmail.com> wrote:
>
>> This has always struck me as particularly elegant in scripts. Cons= ider:
>>
>>=C2=A0 =C2=A0 =C2=A0cat "$@" | whatever
>>
>> (Or you may prefer `cat $* | whatever`)
>>
>> Now one's script can take any number of file arguments or stdi= n, even if
>> the filter does not.
>
> I think Dan has hit the heart of the matter. People are used to using<= br> > cat for multiple files to start pumping data down a pipeline, so they<= br> > continue to do so even when there's only one file.
>

The classic example is:

=C2=A0 $ cat file | grep foo

instead of the simpler:

=C2=A0 $ grep foo file

It appears cat(1) and pipe(7) are deeply ingrained in people's brains.<= br>
--Andy
--000000000000905dc305b5a36014--