Re: FW: +N option in tail command

2009-11-11 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to נחשון ישורון/Nachshon Yeshurun on 11/11/2009 12:11 AM:
 Hello
 
 Man pages for the tail command shows the ability to use the +N option.

No, the man pages mention the ability to use the option -n+N.

In fact, because that was so confusing, it has recently been changed.  If
you were to upgrade to coreutils 8.0, you'd see this instead:

  -n, --lines=Koutput the last K lines, instead of the last 10;
   or use -n +K to output lines starting with the Kth

to try to reduce the confusion between the option (-n) and the argument to
the option (+K).

 Is this a bug?

No.  And it is a FAQ:
http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Old-tail-plus-N-syntax-now-fails

- --
Don't work too hard, make some time for fun as well!

Eric Blake e...@byu.net
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkr6tacACgkQ84KuGfSFAYBmVQCfcnhDNfwVaDc3YO7Y2ky0WVUf
ZIQAnREALS8rnmCkDNJM7JSvjc4vhOz+
=gcyd
-END PGP SIGNATURE-




Re: FW: +N option in tail command

2009-11-11 Thread Philip Rowlands

On Wed, 11 Nov 2009, נחשון ישורון/Nachshon Yeshurun wrote:


Man pages for the tail command shows the ability to use the +N option.
Yet, attempting it on Ubuntu 9.10 results in an error.
Is this a bug?


Not a bug.


From man pages:

 -n, --lines=N
 output the last N lines, instead of the last 10; or  use  +N  to
 output lines starting with the Nth


Attempting the command:

nachs...@nachshon-ubuntu-vm:~/temp$ tail +5 /etc/passwd
tail: cannot open `+5' for reading: No such file or directory


The manpage syntax should be read as
$ tail -n +5
or
$ tail --lines=+5


Regarding the bare tail +5 and the issues surrounding this usage 
please see:

http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Old-tail-plus-N-syntax-now-fails


Cheers,
Phil