[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch] documentation bug in tail: no mention of -n +N syntax
From: |
Evan Hunt |
Subject: |
[patch] documentation bug in tail: no mention of -n +N syntax |
Date: |
Sat, 16 Dec 2006 00:48:18 -0800 |
User-agent: |
Mutt/1.5.10i |
I was bitten this evening by the fact that the old "tail +N" syntax--in
other owrds, "omit the first N lines of the file, then show the rest"--has
been deprecated. (That was an unforunate decision on POSIX's part, IMHO,
but I see it's already been discussed at length on this list, so nevermind).
In trying to figure out how to fix my script, I checked "tail --help" and
"man tail", and there was no mention of the fact that tail even *has* this
ability anymore. Eventually I dug up the "tail -n +N" option on a web
page, and that worked.
So the patch below clarifies the documentation.
Evan Hunt
===================================================
diff -u tail.c.00 tail.c
--- tail.c.00 2006-12-15 22:34:58.000000000 -0800
+++ tail.c 2006-12-16 00:07:00.000000000 -0800
@@ -231,7 +231,9 @@
inaccessible when tail starts or if it becomes\n\
inaccessible later; useful when following by
name,\n\
i.e., with --follow=name\n\
- -c, --bytes=N output the last N bytes\n\
+ -c, --bytes=N if N is preceded by no sign or a '-', output the\n\
+ last N bytes; if it is preceded by a '+', output\n\
+ all bytes after the first N\n\
"), stdout);
fputs (_("\
-f, --follow[={name|descriptor}]\n\
@@ -241,7 +243,9 @@
-F same as --follow=name --retry\n\
"), stdout);
printf (_("\
- -n, --lines=N output the last N lines, instead of the last %d\n\
+ -n, --lines=N if N is preceded by no sign or a '-', output the\n\
+ last N lines (default %d); if it is preceded by\n\
+ a '+', output all lines after the first N.\n\
--max-unchanged-stats=N\n\
with --follow=name, reopen a FILE which has not\n\
changed size after N (default %d) iterations\n\
- [patch] documentation bug in tail: no mention of -n +N syntax,
Evan Hunt <=