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 2839 invoked from network); 4 Dec 2020 01:26:04 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 4 Dec 2020 01:26:04 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 491BB9CA66; Fri, 4 Dec 2020 11:26:01 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 51B539CA4F; Fri, 4 Dec 2020 11:25:45 +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="FP8pHLu9"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id D1BA29CA4F; Fri, 4 Dec 2020 11:25:43 +1000 (AEST) Received: from mail-qt1-f177.google.com (mail-qt1-f177.google.com [209.85.160.177]) by minnie.tuhs.org (Postfix) with ESMTPS id 328DC9CA4B for ; Fri, 4 Dec 2020 11:25:43 +1000 (AEST) Received: by mail-qt1-f177.google.com with SMTP id p12so2916616qtp.7 for ; Thu, 03 Dec 2020 17:25:43 -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=KiVtRge+ICeOAJBM1tsRrAWdB9tkhphRszBDZyGZ3i0=; b=FP8pHLu9fMYb+CKit2Jdi6zXTUkqdbusvrAQp5/7gNH+ASGi23KGakxAmHnvGIGOa6 AxGDl4xmv8XjI7KmqZztjG1mNZeQeMypiXNVoFRC1hFl2vgthdCOtee8LRo/bpBDCLFw 6Bd1fb/ZaLz152Zs+Y93muOqXXTTK5vfA0HddN8QUKoMMiA7vXXIWQ7C8gtSe0k0Y07L ebSr/M5wyZDSLdfwlqUxZM2cL9DpggIFYRVnK51pab610/IhmfZuIURqzV5mMouOzw1F N11kgd9OtZgNumT7+yIZuPBOo/g2mByTabSlXoYJ2+Ml8zcPc3oJqNeQkyPbp18basQd mp/Q== 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=KiVtRge+ICeOAJBM1tsRrAWdB9tkhphRszBDZyGZ3i0=; b=UpYDpa21DJ/GS4q4LCoB9dYrN69WWUVi7UTSVI7+47N2F6Sgis4uRZWSZbDLNCabMP PNAjHsqveOlO0sH1ka0NRBiutdW7IQZRwTMH46ywwVgPw3F8Sg8eVYcTkZo56IbyWtAn 5k+NbGFN3thkaI5jXOeXZH8/0Jjw6v5ya5Ge8R+Lb3WrmK0cjDwXu3D62smiX5L+JFgC jzceSuWOVhf6GjXb7BSm7ziMQaAm/ra6P59JCSfTOpxYAMJfbsA3KzB3zviNUen5Tp/i rQ5i0MQnMJ/wS9xCumC5HuEuQ1OtELTl9vhzBVpwexVSX9iRbc35IC35v96MDXy5huys 0ncg== X-Gm-Message-State: AOAM53271K6l6/b7Fdfl8x+i27nN/mpw0F8oiB7wmdXl3V1T5jEfPvZ5 mEagFakOEchuXnHkJ9OxtA9HMREiTZStt01My8U= X-Google-Smtp-Source: ABdhPJzIFdVdYbavm9W+b8jjpmfRqNKHM8fNg7ALIg+wt5ytZDwmpoMf7VUEfNjivUkpGwsx/nzfHmlpTPtC3tTGFlk= X-Received: by 2002:ac8:5653:: with SMTP id 19mr6876103qtt.136.1607045142189; Thu, 03 Dec 2020 17:25:42 -0800 (PST) MIME-Version: 1.0 References: <20201203204301.GW19746@mcvoy.com> In-Reply-To: From: Dan Cross Date: Thu, 3 Dec 2020 20:25:06 -0500 Message-ID: To: Rob Pike Content-Type: multipart/alternative; boundary="000000000000d69c9305b5995a27" 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" --000000000000d69c9305b5995a27 Content-Type: text/plain; charset="UTF-8" On Thu, Dec 3, 2020 at 7:44 PM Rob Pike wrote: > I've long been fascinated by the prevalence of > > cat file | process > > and think of it as a sort of triumph of the model. Pipes are more natural > than redirection as a human interface. > 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. - Dan C. On Fri, Dec 4, 2020 at 11:30 AM Dave Horsfall wrote: > >> On Thu, 3 Dec 2020, Larry McVoy wrote: >> >> > Wasn't there a version that was >> > >> > cat whatever ^ wc -l >> >> Sort of pipe-related, but one thing that really gets my goat is the >> inefficient redundancy in "cat file | process" when "process < file" will >> suffice (and I'll bet that I'm not alone). >> >> And yes, "^" preceded "|" for reasons discussed later in this thread. >> >> -- Dave >> > --000000000000d69c9305b5995a27 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Dec 3, 2020 at 7:44 PM Rob Pike &= lt;robpike@gmail.com> wrote:
I've long been fascinated by the prevalence= of

=C2=A0 =C2=A0cat file | process

=
and think of it as a sort of triumph of the model. Pipes are more natu= ral than redirection as a human interface.
This has always struck me as particularly elegant in scripts. C= onsider:

=C2=A0 =C2=A0 cat "$@" | whatev= er

(Or you may prefer `cat $* | whatever`)

Now one's script can take any number of file argument= s or stdin, even if the filter does not.

=C2=A0 = =C2=A0 =C2=A0 =C2=A0 - Dan C.

On Fri, Dec 4, 2020 at 11:30= AM Dave Horsfall <dave@horsfall.org> wrote:
On Thu, 3 Dec 2020, Lar= ry McVoy wrote:

> Wasn't there a version that was
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0cat whatever ^ wc -l

Sort of pipe-related, but one thing that really gets my goat is the
inefficient redundancy in "cat file | process" when "process= < file" will
suffice (and I'll bet that I'm not alone).

And yes, "^" preceded "|" for reasons discussed later i= n this thread.

-- Dave
--000000000000d69c9305b5995a27--