|
From: | GNU bug Tracking System |
Subject: | [debbugs-tracker] bug#6605: closed (+N lines broken with /usr/bin/tail (GNU coreutils) 7.4) |
Date: | Thu, 25 Aug 2011 05:41:01 +0000 |
Your message dated Wed, 24 Aug 2011 23:38:13 -0600 with message-id <address@hidden> and subject line Re: bug#6605: +N lines broken with /usr/bin/tail (GNU coreutils) 7.4 has caused the GNU bug report #6605, regarding +N lines broken with /usr/bin/tail (GNU coreutils) 7.4 to be marked as done. (If you believe you have received this mail in error, please contact address@hidden) -- 6605: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6605 GNU Bug Tracking System Contact address@hidden with problems
--- Begin Message ---Subject: +N lines broken with /usr/bin/tail (GNU coreutils) 7.4 Date: Sat, 10 Jul 2010 03:50:32 -0700 (PDT)
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
...
According to the documentation (and my previous experience shell scripting) It should have printed the tail of data.txt starting with the 2nd line, like this:
line 2
line 3
line 4
Looks like it just needs a little code near the getopt() call (or however the command line is parsed) to recognize "+" as an option indicator.
This is useful for example to implement a stack:
function pop
{
FILENAME=`head -1 data.file`
tail +2 data.file > data.file.tmp
mv data.file.tmp data.file
}
function push
{
echo "$FILENAME" > data.file.line1
cat data.file.line1 data.file > data.file.tmp
mv data.file.tmp data.file
}
Thanks for your attention.
--- End Message ---
--- Begin Message ---Subject: Re: bug#6605: +N lines broken with /usr/bin/tail (GNU coreutils) 7.4 Date: Wed, 24 Aug 2011 23:38:13 -0600 User-agent: Mutt/1.5.21 (2010-09-15) > http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6605 It has been a year since any feedback has been provided on this issue in the bug tracking system. I believe that the discussion logged so far was sufficient to fully resolve the issue. Therefore I am closing this bug. Feel free to follow-up with more information if desired. Bob
--- End Message ---
[Prev in Thread] | Current Thread | [Next in Thread] |