From owner-freebsd-questions@freebsd.org Thu Sep 28 08:27:05 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF8B2E2C6DB for ; Thu, 28 Sep 2017 08:27:05 +0000 (UTC) (envelope-from freebsd@erwanlegrand.com) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D4E97511F for ; Thu, 28 Sep 2017 08:27:04 +0000 (UTC) (envelope-from freebsd@erwanlegrand.com) X-Originating-IP: 209.85.192.173 Received: from mail-pf0-f173.google.com (mail-pf0-f173.google.com [209.85.192.173]) (Authenticated sender: moi@erwan.legrand.name) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 7CE7BC5A60 for ; Thu, 28 Sep 2017 10:26:57 +0200 (CEST) Received: by mail-pf0-f173.google.com with SMTP id r71so502629pfe.12 for ; Thu, 28 Sep 2017 01:26:57 -0700 (PDT) X-Gm-Message-State: AHPjjUjLyPmoOfalTzi70KKQ7pAp+X3FQOjkzjIk5Mt/nKHMwGcqcv14 UGSGzx320TTMXsGeKGk0iwZkiilkBXlXK4+a91c= X-Google-Smtp-Source: AOwi7QCOSFl8uswo21TyZHitbRQCatnL+PxO8gzTfoDj18MdflfI1YV1DqkPFIzfJZ7Jr6rE+WS+UJmLlUN5Ie0qEsI= X-Received: by 10.99.63.14 with SMTP id m14mr358387pga.236.1506587215809; Thu, 28 Sep 2017 01:26:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.163.3 with HTTP; Thu, 28 Sep 2017 01:26:55 -0700 (PDT) In-Reply-To: <20170927202811.GA2799@c720-r314251> References: <20170927195828.GA77592@g5.umpquanet.com> <20170927202811.GA2799@c720-r314251> From: Erwan Legrand Date: Thu, 28 Sep 2017 10:26:55 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Possible bug in tail(1) To: Matthias Apitz , list@museum.rain.com, FreeBSD Questions Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Sep 2017 08:27:05 -0000 On Wed, Sep 27, 2017 at 10:28 PM, Matthias Apitz wrote: > The essence of the issue seems to be if tail(1) is reading a file/stdin > or a pipe: > > $ cat foor > > 3 > 2 > 1 > $ tail -r foor > 1 > 2 > 3 > > $ tail -r < foor > 1 > 2 > 3 > > $ cat foor | tail -r > 1 > 2 > > 3 This works for me with 11.0-RELEASE-p12: [erwan@melkor /tmp]% cat foor 3 2 1 [erwan@melkor /tmp]% tail -r foor 1 2 3 [erwan@melkor /tmp]% cat foor | tail -r 1 2 3 [erwan@melkor /tmp]% type tail tail is /usr/bin/tail But then, I use zsh, not bash.