bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#6605: +N lines broken with /usr/bin/tail (GNU coreutils) 7.4


From: Davide Brini
Subject: bug#6605: +N lines broken with /usr/bin/tail (GNU coreutils) 7.4
Date: Sat, 10 Jul 2010 20:53:30 +0100

On Sat, 10 Jul 2010 03:50:32 -0700 (PDT) Forest Oakwater
<address@hidden> wrote:

> Using this data file:
> address@hidden:~/backgrounds/frazetta$ cat data.txt
> line 1
> line 2
> line 3
> line 4
> 
> and this command:
> address@hidden:~/backgrounds/frazetta$ /usr/bin/tail +2 data.txt
> /usr/bin/tail: cannot open `+2' for reading: No such file or directory
> ==> data.txt <==
> line 1
> line 2
> line 3
> line 4
> 
> Output was incorrect.  The manpage and builtin help text both state:
> 
> address@hidden:~/backgrounds/frazetta$ /usr/bin/tail --help
> ...
>   -n, --lines=N            output the last N lines, instead of the last
> 10; or use +N to output lines starting with the Nth
> ...

This is not what you did. You did "tail +2", whereas the man says you
should do "tail -n +2", or "tail --lines=+2". If you want to output the
last N lines, rather than starting from the Nth, you'd do "tail -n 2" or
"tail --lines=2".

The "tail +2" syntax is obsolete; probably the recent versions of coreutils
(which 7.4 is not, anyway) dropped support for it.

-- 
D.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]