[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tail +n does not work under Linux?
From: |
Eric Blake |
Subject: |
Re: tail +n does not work under Linux? |
Date: |
Fri, 29 May 2009 08:15:12 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Eric Blake on 5/20/2009 8:20 AM:
>> CNT doesn't read too well :)
>> How about COUNT or NUM?
>
> COUNT runs into length problems - adding 4 characters per instance builds up
> fast. I'll try with NUM instead. As it is, I already had to rephrase things
> since "nth" is a word, but "count'th" and "num'th" are not.
According to Matthew Woehlke on 5/20/2009 10:22 AM:
>
> s/N/K/ ? :-)
>
> Is "K'th" item too awkward? (Or some other letter that isn't 'N'?)
I like the idea of Kth. How about this version of the patch?
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----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
iEYEARECAAYFAkof7fAACgkQ84KuGfSFAYApVACgwlNoIVLPS4Fd6ZaxC/r1295+
6tsAnAu69i4YgX72Rg9Xffh7z3ZuL5Lk
=Wyyy
-----END PGP SIGNATURE-----
From 2feabaacb7cdd2cdd4e01266d4e078dbdf31d7b4 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Wed, 20 May 2009 06:32:10 -0600
Subject: [PATCH] head, tail: make --help less ambiguous
* src/head.c (usage): Use -n K, not -n N, to avoid confusion.
* src/tail.c (usage): Likewise.
* doc/coreutils.texi (head invocation, tail invocation):
Likewise.
Reported by Christophe Lyon.
---
doc/coreutils.texi | 44 ++++++++++++++++++++++----------------------
src/head.c | 13 +++++++------
src/tail.c | 17 +++++++++--------
3 files changed, 38 insertions(+), 36 deletions(-)
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 97ea830..8cc46a0 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -2653,22 +2653,22 @@ head invocation
@table @samp
address@hidden -c @var{n}
address@hidden address@hidden
address@hidden -c @var{k}
address@hidden address@hidden
@opindex -c
@opindex --bytes
-Print the first @var{n} bytes, instead of initial lines.
-However, if @var{n} starts with a @samp{-},
-print all but the last @var{n} bytes of each file.
address@hidden
+Print the first @var{k} bytes, instead of initial lines.
+However, if @var{k} starts with a @samp{-},
+print all but the last @var{k} bytes of each file.
address@hidden
address@hidden -n @var{n}
address@hidden address@hidden
address@hidden -n @var{k}
address@hidden address@hidden
@opindex -n
@opindex --lines
-Output the first @var{n} lines.
-However, if @var{n} starts with a @samp{-},
-print all but the last @var{n} lines of each file.
+Output the first @var{k} lines.
+However, if @var{k} starts with a @samp{-},
+print all but the last @var{k} lines of each file.
Size multiplier suffixes are the same as with the @option{-c} option.
@item -q
@@ -2738,14 +2738,14 @@ tail invocation
@table @samp
address@hidden -c @var{n}
address@hidden address@hidden
address@hidden -c @var{k}
address@hidden address@hidden
@opindex -c
@opindex --bytes
-Output the last @var{n} bytes, instead of final lines.
-However, if @var{n} starts with a @samp{+}, start printing with the
address@hidden byte from the start of each file, instead of from the end.
address@hidden
+Output the last @var{k} bytes, instead of final lines.
+However, if @var{k} starts with a @samp{+}, start printing with the
address@hidden byte from the start of each file, instead of from the end.
address@hidden
@item -f
@itemx address@hidden
@@ -2850,13 +2850,13 @@ tail invocation
and when it prints the lines that have accumulated in the new log file.
This option is meaningful only when following by name.
address@hidden -n @var{n}
address@hidden address@hidden
address@hidden -n @var{k}
address@hidden address@hidden
@opindex -n
@opindex --lines
-Output the last @var{n} lines.
-However, if @var{n} starts with a @samp{+}, start printing with the
address@hidden line from the start of each file, instead of from the end.
+Output the last @var{k} lines.
+However, if @var{k} starts with a @samp{+}, start printing with the
address@hidden line from the start of each file, instead of from the end.
Size multiplier suffixes are the same as with the @option{-c} option.
@item -q
diff --git a/src/head.c b/src/head.c
index 7f90d4b..c96f910 100644
--- a/src/head.c
+++ b/src/head.c
@@ -1,5 +1,6 @@
/* head -- output first part of file(s)
- Copyright (C) 89, 90, 91, 1995-2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 89, 90, 91, 1995-2006, 2008-2009 Free Software
+ Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -118,12 +119,12 @@ With no FILE, or when FILE is -, read standard input.\n\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
- -c, --bytes=[-]N print the first N bytes of each file;\n\
+ -c, --bytes=[-]K print the first K bytes of each file;\n\
with the leading `-', print all but the last\n\
- N bytes of each file\n\
- -n, --lines=[-]N print the first N lines instead of the first 10;\n\
+ K bytes of each file\n\
+ -n, --lines=[-]K print the first K lines instead of the first 10;\n\
with the leading `-', print all but the last\n\
- N lines of each file\n\
+ K lines of each file\n\
"), stdout);
fputs (_("\
-q, --quiet, --silent never print headers giving file names\n\
@@ -133,7 +134,7 @@ Mandatory arguments to long options are mandatory for short
options too.\n\
fputs (VERSION_OPTION_DESCRIPTION, stdout);
fputs (_("\
\n\
-N may have a multiplier suffix:\n\
+K may have a multiplier suffix:\n\
b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\n\
GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\n\
"), stdout);
diff --git a/src/tail.c b/src/tail.c
index fe34600..9d416e1 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1,5 +1,6 @@
/* tail -- output the last part of file(s)
- Copyright (C) 1989, 90, 91, 1995-2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1989, 90, 91, 1995-2006, 2008-2009 Free Software
+ Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -226,8 +227,8 @@ With no FILE, or when FILE is -, read standard input.\n\
Mandatory arguments to long options are mandatory for short options too.\n\
"), stdout);
fputs (_("\
- -c, --bytes=N output the last N bytes; alternatively, use +N to\n\
- output bytes starting with the Nth of each file\n\
+ -c, --bytes=K output the last K bytes; alternatively, use +K to\n\
+ output bytes starting with the Kth of each file\n\
"), stdout);
fputs (_("\
-f, --follow[={name|descriptor}]\n\
@@ -237,8 +238,8 @@ Mandatory arguments to long options are mandatory for short
options too.\n\
-F same as --follow=name --retry\n\
"), stdout);
printf (_("\
- -n, --lines=N output the last N lines, instead of the last %d;\n\
- or use +N to output lines starting with the Nth\n\
+ -n, --lines=K output the last K lines, instead of the last %d;\n\
+ or use +K to output lines starting with the Kth\n\
--max-unchanged-stats=N\n\
with --follow=name, reopen a FILE which has not\n\
changed size after N (default %d) iterations\n\
@@ -264,9 +265,9 @@ Mandatory arguments to long options are mandatory for short
options too.\n\
fputs (VERSION_OPTION_DESCRIPTION, stdout);
fputs (_("\
\n\
-If the first character of N (the number of bytes or lines) is a `+',\n\
-print beginning with the Nth item from the start of each file, otherwise,\n\
-print the last N items in the file. N may have a multiplier suffix:\n\
+If the first character of K (the number of bytes or lines) is a `+',\n\
+print beginning with the Kth item from the start of each file, otherwise,\n\
+print the last K items in the file. K may have a multiplier suffix:\n\
b 512, kB 1000, K 1024, MB 1000*1000, M 1024*1024,\n\
GB 1000*1000*1000, G 1024*1024*1024, and so on for T, P, E, Z, Y.\n\
\n\
--
1.6.3.rc3.2.g4b51
- Re: tail +n does not work under Linux?, (continued)
- Re: tail +n does not work under Linux?, Christophe LYON, 2009/05/07
- Re: tail +n does not work under Linux?, Matthew Woehlke, 2009/05/07
- Re: tail +n does not work under Linux?, Christophe LYON, 2009/05/11
- Re: tail +n does not work under Linux?, Bob Proulx, 2009/05/11
- Re: tail +n does not work under Linux?, Christophe LYON, 2009/05/12
- Re: tail +n does not work under Linux?, Eric Blake, 2009/05/20
- Re: tail +n does not work under Linux?, Jim Meyering, 2009/05/20
- Re: tail +n does not work under Linux?, Pádraig Brady, 2009/05/20
- Re: tail +n does not work under Linux?, Eric Blake, 2009/05/20
- Re: tail +n does not work under Linux?, Matthew Woehlke, 2009/05/20
- Re: tail +n does not work under Linux?,
Eric Blake <=
- Re: tail +n does not work under Linux?, Pádraig Brady, 2009/05/29
- Re: tail +n does not work under Linux?, Jim Meyering, 2009/05/29
- Re: tail +n does not work under Linux?, Eric Blake, 2009/05/29
- Re: tail +n does not work under Linux?, Christophe LYON, 2009/05/20
Re: tail +n does not work under Linux?, Alfred M. Szmidt, 2009/05/08