Possible bug in tail(1)

Matthias Apitz guru at unixarea.de
Wed Sep 27 21:32:11 UTC 2017


El día miércoles, septiembre 27, 2017 a las 12:58:28p. m. -0700, list at 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 at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20170927/784eb868/attachment.sig>


More information about the freebsd-questions mailing list