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=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28895 invoked from network); 15 Jul 2021 22:01:05 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 15 Jul 2021 22:01:05 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 156AD9C852; Fri, 16 Jul 2021 08:01:01 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 724ED9C7F1; Fri, 16 Jul 2021 08:00:41 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=dartmouth.edu header.i=@dartmouth.edu header.b="hL9BIS8d"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 7890E9C7F1; Fri, 16 Jul 2021 08:00:37 +1000 (AEST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by minnie.tuhs.org (Postfix) with ESMTPS id 8750F9C7F0 for ; Fri, 16 Jul 2021 08:00:36 +1000 (AEST) Received: by mail-wm1-f42.google.com with SMTP id u8-20020a7bcb080000b02901e44e9caa2aso4550928wmj.4 for ; Thu, 15 Jul 2021 15:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dartmouth.edu; s=google1; h=mime-version:from:date:message-id:subject:to; bh=RY35fMM3S2gm7zfuJN6XXYbQTLVtKJYts3A7Xczuuhk=; b=hL9BIS8de5DnP9flgz43RCmq6LpHrgEkX+2anHSI55ZQ88d3lSyU1BlUzK+SlkfvhZ Peq0RWHeZCHaJS+etcwbjr3Uz03o9sUHhiOcrfAa7fjSjS51tfgnIxikqKNHIymHOBNt E3sOM81/9vk9oNQUOgxltaJgZuLGnBnErOV859zlP2i5k6SQQ/wFgLk0B16LyscmS6Vc b3vtK8jPUswbe5p3myHrn+DrmgsrSNgQUcxewqAv+gofKGdX3xBcIxQzWRp6pKHHjx1I W3xBbIZsez0wJ4nw1EH44gysR/ErQtZ71RIRJt4WFgfttEYtTk7aho5oKR57srt4za7y +sSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=RY35fMM3S2gm7zfuJN6XXYbQTLVtKJYts3A7Xczuuhk=; b=tl+vC+9Wvg0FskaHxxCe5+6Hrp+ACBNVWQAAl/ZjC8HrZXRtSwIIpOKJUoCz1Lmy1G s2V71FmZUX2uteNzZ8ckSveUQGPHZ60e0e9TdzGUUis3J5c6fFnk8K0xzLbN5pwWgvlb 733JDakTT0oAQ9QcGcZ6JfEVU6XpB/rkUaIX7PMmSFIg4C5OClsFO5iLlXAqchu1Uv7s oT7c5JoATMoy1KKuJ2PWbUv6zb2C5faf5kGW5w9xzp4LZmHVkjyiH9XVx5GFwD+F8+h+ 08/hBF2Hp0RZZerDn+LkOPJGmhsbKjM8tBIPKcLqM/6orqbf1KV7g1cV53ztxr7397Af S5Vw== X-Gm-Message-State: AOAM533AEchSVpdAOyk6SuPRQUrG9AbgRMNFDua3rQ7H/hxho0OO2IbP VaY0BpZoFZ1GqnguP1xN1c3bVexzfbUYz8G4JSxGX1y1k3MATA== X-Google-Smtp-Source: ABdhPJxDTjCIzgGB8sncz9ch3lvHVx79vJte5vWeJjN3l9tahBwyqmPr1d/JAgT/mTjaC5KyhzH2Ybul1Nack6Au+ds= X-Received: by 2002:a1c:39d5:: with SMTP id g204mr12878054wma.66.1626386434906; Thu, 15 Jul 2021 15:00:34 -0700 (PDT) MIME-Version: 1.0 From: Douglas McIlroy Date: Thu, 15 Jul 2021 18:00:19 -0400 Message-ID: To: TUHS main list Content-Type: text/plain; charset="UTF-8" Subject: Re: [TUHS] head/sed/tail (was The Unix shell: a 50-year view) 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: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" >> -f is a strange feature that effectively turns a regular file into a pipe >> with memory by polling for new data, A clean general alternative >> might be to provide an open(2) mode that makes reads at the current >> file end block if some process has the file open for writing. > OTOH, this would mean adding more functionality (read: complexity) > into the kernel, and there has always been a general desire to avoid > pushing into the kernel when it can be done in userspace. Do > you really think using a blocking read(2) is somehow more superior > than using select(2) to wait for new data to be appended to the file? I'm showing my age. tail -f antedated select(2) and was implemented by alternately sleeping and reading. select(2) indeed overcomes that clumsiness. > I'll note, with amusement, that -r is one option which is *NOT* in the > GNU version of tail. I see it in FreeBSD, but this looks like a > BSD'ism. -r came from Bell Labs. This reinforces the point that the ancients had their imperfections. Doug