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 10773 invoked from network); 4 Dec 2020 13:26:24 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 4 Dec 2020 13:26:24 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id B83C19CA55; Fri, 4 Dec 2020 23:26:23 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 280149CA4F; Fri, 4 Dec 2020 23:26:08 +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="awE6dtsu"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 73E559CA4F; Fri, 4 Dec 2020 23:26:06 +1000 (AEST) Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) by minnie.tuhs.org (Postfix) with ESMTPS id D8D209CA4B for ; Fri, 4 Dec 2020 23:26:05 +1000 (AEST) Received: by mail-vs1-f41.google.com with SMTP id z16so3227071vsp.5 for ; Fri, 04 Dec 2020 05:26:05 -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=TGmf1wHHC2Ey91A6YyEMLgk0OX3pBENexAV/bnJa9yw=; b=awE6dtsuQvBfQ2XIU7q3X5zizz4PWBsL/g67agXqCFJ1QNG3hh5HKg1is8455Ulycy H93RYoCi8QXnZosI0NbJjpEksh9ouJFCfgF+Z1/QK0sVEerOtj/xeMk5WRaOCpgNACvB CXuCpU9T8MvgKospix1Q169oDAxk2j3Lr46UKyeAbsnBwK+7vp1vC1DuV4e7FrVH5MU1 naxC4BgudOuBqBcEmyfVwkcQ3Y6EbfJ3Gs+EsIzuxpaMPfdbzbXniCVNAJjO/V7MYwlp 9xxNDF67BvwNQ74DMj9Lyeue4XNDiwkJFFdRLJHrrtPVc7laguAbtxIoUzlxl6+wyW5m KP9A== 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=TGmf1wHHC2Ey91A6YyEMLgk0OX3pBENexAV/bnJa9yw=; b=S8O2plKnuesRULMa0i5FYPeT+2e3TeK5GRhH5R9wPTYFIDyjWkydukSmgC6s5MVahW MbOPDncDcNpZWD/53djnmDfCSmzUunJ9SsTRArx9MXgl9eGzV5i4fb3MtjSbC6wVrh0T p8MHk4mK+EkySPdG4q2VWJK9pNfQV37F7jvQwmieMmLGVbbChvRjqs7B4kHJfUn0zwBe Yfl7mjXNPvf80HiDHCxpZ5uIfzKeqLxhlfNFt0BAPgNGVPVjcsqqyy7zKeg4IHiZNIem FY0+clIcrh3UZKz2+KubKpA8agC0QEY16S9GPtAx12lV1Vwod0YaRdEAH0f5DJh9VDDR BxmA== X-Gm-Message-State: AOAM5336UmsVJ0Y9JccXBfe6pZ2Ix7xHqqdZAF7gtGYVzMDQi7Kf3Vaw G4SGzfB7iMubSMYCsziJWfTjgcYwaiElv+PYPHs= X-Google-Smtp-Source: ABdhPJyCsu5Tc4EppSzGlGQ4XL8kCVB39fqe2aBdKKwwooO1HtWt2ZXOSqPBpz2Sc8snZwRbjTX13I92H2tMy6maiWo= X-Received: by 2002:a67:8785:: with SMTP id j127mr2822229vsd.60.1607088364990; Fri, 04 Dec 2020 05:26:04 -0800 (PST) MIME-Version: 1.0 References: <20201203204301.GW19746@mcvoy.com> <202012040927.0B49Rkx6019895@freefriends.org> In-Reply-To: From: Niklas Karlsson Date: Fri, 4 Dec 2020 14:25:53 +0100 Message-ID: To: Tyler Adams Content-Type: multipart/alternative; boundary="0000000000001e34c105b5a36ba3" 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" --0000000000001e34c105b5a36ba3 Content-Type: text/plain; charset="UTF-8" Fair enough, and I guess it gets messy trying to remember all of the odd exceptions. Niklas Den fre 4 dec. 2020 kl 14:23 skrev Tyler Adams : > 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 >>>> >>> --0000000000001e34c105b5a36ba3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Fair enough, and I guess it gets messy trying to reme= mber all of the odd exceptions.

Niklas

De= n fre 4 dec. 2020 kl 14:23 skrev Tyler Adams <coppero1237@gmail.com>:
Not always
$ cat a | while read line; do echo $line; done
#!/usr/bin= /env bash

PUPPETEER_PRODUCT=3Dfirefox npm install -g md-to-pdf

$ < a while read line; do echo $line; done
-= bash: syntax error near unexpected token `do'

=
=C2=A0Tyler

=

On Fri, Dec 4, 2020 at 3:17 PM Niklas Karlsson <nikke.karlsson@gmail.com>= ; wrote:
< file grep foo works.

Niklas

Den fre 4 dec. 2020 kl 14:16 skrev Tyler Adams <coppero1237@gmail.com>:
<= div>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> wrote:
<= /div>
On 12/4/20, arnold@skeeve.com <<= a href=3D"mailto:arnold@skeeve.com" target=3D"_blank">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
--0000000000001e34c105b5a36ba3--