Commit Graph

68 Commits

Author SHA1 Message Date
eadler c197dbace7 [tail] Fix type of 'len'
ok pgoyette
2018-03-06 03:33:26 +00:00
pgoyette d21b747c46 Nit-picking: avoid split infinitive 2017-10-15 03:57:47 +00:00
wiz 696f76c399 Sort options.
-qv are not specific to -r, so separate them.
Add -q and -v descriptions to the general option table.
2017-10-02 08:23:23 +00:00
kre 329c11fb8f Remove some unnecessary words. 2017-10-01 22:35:23 +00:00
maya 9b177b90f0 Add arguments to tail:
-q: suppress filename headers when multiple files are used
  -v: print filename headers even when only one file is used

head already supports the same arguments, which originated in GNU head.
GNU tail also has the same flags.


Add tac, a hard link to 'tail -rq'.
Prints a file in reverse line order.

Similar to GNU tac, but lacking any options.

Add accompanying documentation.
2017-10-01 20:49:24 +00:00
wiz 40396b53cb Add EXIT STATUS section. Use Ex. 2017-07-04 07:01:07 +00:00
wiz 01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
christos 472bcd2198 PR/50322: Timo Buhrmester: tail -F <file> misbehaves with stdin closed
Compare fp with stdin not fileno(fp) with STDIN_FILENO, because if tail
is called with 0 closed, then we are not going to be setting event filters
for the file because we'll erroneously think it is stdin.
2015-10-09 17:51:26 +00:00
wiz 980f4832e1 Fix -f description: it is also ignored if stdin is a FIFO.
From Philip Guenther via jmc@openbsd.
Bump date.
2014-06-15 11:37:56 +00:00
christos 6e28978d84 fix unused variable warnings 2013-10-18 20:47:06 +00:00
wiz 405ebbdc66 Add comma after i.e.
From Bug Hunting.
2013-01-31 23:09:06 +00:00
christos d44b4781e6 minor knf, no functional change. 2011-09-03 10:59:10 +00:00
christos 221bb4e4bf leave the original errno as it was. don't report EFBIG on all mmap failures. 2011-09-03 10:35:13 +00:00
christos 56b933f4a2 Instead of declaring our own err() which is different than the standard one,
and using it incorrectly in a few places because of confusion (does it print
errno or not?), declare two versions following the standard ones xerrx and,
xerr, and use those as appropriate, implementing them using them vwarn and
vwarnx.
2011-09-03 09:02:20 +00:00
lukem 0980aab530 Fix WARNS=4 issues (-Wcast-qual -Wshadow -Wsign-compare)
XXX: need a "cleaner" way to do the check in reverse.c, as a general rule
2009-04-13 23:33:25 +00:00
dholland d65073510e Use off_t, not __off_t. 2008-09-30 04:03:37 +00:00
lukem 98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
christos 0523aae770 PR/37954: Thomas Klausner: "tail -c 2" broken.
It is not tail -c 2 but most of tail -c <n> with pipes. Fix by Anon Ymous
2008-02-04 16:23:11 +00:00
christos a740c3d0aa Coverity CID 3204: The USE_SLEEP case can close the fp, and break does
not break from the loop, only from the switch. Make it break from the
loop to avoid a NULL pointer dereference.
2006-05-24 16:34:25 +00:00
christos 7d7dff8590 Coverity CID 2986: Free lines before returning. 2006-04-30 23:27:15 +00:00
christos 79059c6361 Coverity CID 1563: Fix memory leak. 2006-04-09 19:42:03 +00:00
christos 3bf01f5c84 Duh fixed error printing. 2006-04-09 19:39:17 +00:00
christos 034e8bc313 Coverity CID 1580: Plug memory leak. 2006-04-09 19:37:50 +00:00
chs 7bbdd188e1 appease gcc -Wuninitialized on hp700. 2005-06-05 19:08:28 +00:00
lukem ef45472693 appease gcc -Wuninitialized 2005-06-02 03:00:19 +00:00
itojun 7551fb024f do not use long for file offset, use off_t. otto@openbsd 2004-02-16 21:57:04 +00:00
itojun d5250e4ec9 safer use of realloc 2003-10-16 06:34:19 +00:00
agc 89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
itojun 6a949dc545 minor KNF 2003-07-14 09:30:52 +00:00
lukem 8bfad4ad7a Use sleep(1) instead of usleep(1000000) to sleep for a second, since
usleep() doesn't support an argument >= 1000000.
Problem noted & fix provided in [bin/20644] from Dave Huang.
2003-03-10 08:04:15 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
jdolecek 64275c4aaf use kqueue to watch the file if possible
from FreeBSD via Luke Mewburn

this specifically does NOT include FreeBSD rev. 1.28 change; it's
my understanding -F is specifically meant to only detect removal
of the tailed file, not to watch for intermediate path changes
2002-10-30 21:48:50 +00:00
skrll 5152db4b16 Update error message after recent changes. 2002-09-18 19:29:12 +00:00
mycroft 855996c546 Remove an old comment. 2002-09-18 19:21:41 +00:00
mycroft 1bf9916dae select() -> nanosleep() 2002-09-18 19:14:58 +00:00
wiz 3c4c9d2b57 Remove #if __STDC__. De-__P() and ANSIfy. 2002-06-14 00:41:42 +00:00
wiz 0deefd986b Add -F to usage, per bin/16558 by Ryan Younce. 2002-04-29 20:12:31 +00:00
ross 2a76afae02 Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:36:18 +00:00
wiz 9e7ca30945 Sort sections. 2001-12-08 19:17:23 +00:00
wiz aded0d2cce Whitespace cleanup. 2001-12-01 16:43:07 +00:00
explorer 78762d72a5 fix tail; don't try to map more of the file than really exists 2001-11-24 02:30:17 +00:00
explorer a3c923dc72 make tail -f and tail -10000 work on files > those which can be mmap()ed whole. tail -r will still not function on large files. 2001-11-21 06:47:07 +00:00
cgd 9cfe468c74 avoid C sequence point issues warned about by development version of gcc. 2001-01-16 02:41:17 +00:00
lukem c2b84904ae use %ll_ instead of the less standard %q_ 2001-01-04 23:05:54 +00:00
is 135600f947 More format string cleanup by sommerfeld. 2000-10-11 14:46:00 +00:00
cgd b02d81404c avoid repeated error messages by making bytes(), lines() and rlines() return
meaningful values, which can then be checked to avoid another error message.
1999-07-21 06:38:49 +00:00
garbled 9e44e9b578 More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages.  Many more to
come.
1999-03-22 18:16:34 +00:00
christos eb4463abfe KNF 1998-12-19 22:27:54 +00:00
christos 7872ac63c8 explicitly zero the lines structure! How did this ever work before? 1998-11-03 14:27:09 +00:00
christos 8d721633cd Pacify gcc-2.8.1 (extra braces). 1998-11-03 14:26:45 +00:00