Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Sep 2017 22:28:11 +0200
From:      Matthias Apitz <guru@unixarea.de>
To:        list@museum.rain.com
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Possible bug in tail(1)
Message-ID:  <20170927202811.GA2799@c720-r314251>
In-Reply-To: <20170927195828.GA77592@g5.umpquanet.com>
References:  <20170927195828.GA77592@g5.umpquanet.com>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
El día miércoles, septiembre 27, 2017 a las 12:58:28p. m. -0700, list@museum.rain.com escribió:

> Is it reasonable to expect that tail -r is reversable?  That is, should:
> 
> tail -r foo | tail -r
> 
> produce the same output as:
> 
> cat foo
> 
> for all text files foo?
> 
> The script below creates a file foo for which the above does not
> hold.

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



-- 
Matthias Apitz, ✉ guru@unixarea.de, ⌂ http://www.unixarea.de/  ☎ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
8. Mai 1945: Wer nicht feiert hat den Krieg verloren.
8 de mayo de 1945: Quien no festeja perdió la Guerra.
May 8, 1945: Who does not celebrate lost the War.

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEXmn7rBYYViyzy/vBR8z35Hb+nREFAlnMCdgACgkQR8z35Hb+
nRFiVQ//UbnswQfhIonTZIsXYGeO6uzbMNKseJ3VKThE3dm20QZqYCQFUQSrqCM7
92qi0JQESeXvezOltvlpg7kX4on980lqKd/BT9BzaRyxAs8DPkD/n/fVKUBFgMNH
ULzHSfmr+faSyEljrJ9AZFhsgaQgPb7y7upnYd/C9Wt/twy1EfaJTriZIStSrmnv
q1wxX8ciR6+feBDGDhq6LQ83XZkEVhBES8STCtgSvDzArJra+20d1oOGtg1ChRfS
WVi/aEVMUBelPkrYdpLRAgqVViOJ9P+gM+rwzHn6LDpBf9WIRWsmYAtUjVYnkONa
2K3IX0BNL3dysQyJ2cReTVDq2jra3J/dsyF+mCIIyvhStgkU7jPtAgos1iGAH7tb
/tEujk1yeIiwIcTKUE1W+4o81q8iuxQsXOC3yMlUoZJw51rd2ZXRkgI43CXVRHK2
Ga8QJ2th2fcnSa8ibq3gzo5iYj8GyS/amKx8p+fhWtQGzfNi9mVMeI6ujhMJNp9K
l1nY7ILkAlVeGV/bw3tpqhehPYIjPzA/878nFR/gae8tTeewXGwMZalyxnWgJ5b8
4MrOnzxxZ8jJGECaunvM2VwZXZrDFPM/b+vqnxPIWvNoCl+4PC5+gtMDgmsTqyp4
MrUeY0OSmxXpjJrJEXqAqlzppElof2ocMhHQfszqF2yA3KHwUKM=
=za8D
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170927202811.GA2799>