Possible bug in tail(1)

Erwan Legrand freebsd at erwanlegrand.com
Thu Sep 28 08:27:05 UTC 2017


On Wed, Sep 27, 2017 at 10:28 PM, Matthias Apitz <guru at unixarea.de> 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 at melkor  /tmp]% cat foor

3
2
1
[erwan at melkor  /tmp]% tail -r foor
1
2
3

[erwan at melkor  /tmp]% cat foor | tail -r
1
2
3

[erwan at melkor  /tmp]% type tail
tail is /usr/bin/tail


But then, I use zsh, not bash.


More information about the freebsd-questions mailing list