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




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-




FW: +N option in tail command

2009-11-11 Thread נחשון ישורון/Nachshon Yeshurun

Hello

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?

>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
==> /etc/passwd <==
avahi-autoipd:x:104:110:Avahi autoip daemon,,,:/var/lib/avahi-autoipd:/bin/false
avahi:x:105:111:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/bin/false
couchdb:x:106:113:CouchDB Administrator,,,:/var/lib/couchdb:/bin/bash
haldaemon:x:107:114:Hardware abstraction layer,,,:/var/run/hald:/bin/false
speech-dispatcher:x:108:29:Speech 
Dispatcher,,,:/var/run/speech-dispatcher:/bin/sh
kernoops:x:109:65534:Kernel Oops Tracking Daemon,,,:/:/bin/false
saned:x:110:116::/home/saned:/bin/false
pulse:x:111:117:PulseAudio daemon,,,:/var/run/pulse:/bin/false
gdm:x:112:119:Gnome Display Manager:/var/lib/gdm:/bin/false
nachshon:x:1000:1000:Nachshon,,,:/home/nachshon:/bin/bash