Home | History | Annotate | only in /src/usr.bin/tail
History log of /src/usr.bin/tail
RevisionDateAuthorComments
 1.4 01-Oct-2017  maya 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.
 1.3 23-Nov-1994  jtc Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
 1.2 30-Jul-1993  mycroft Add RCS identifiers.
 1.1 30-Apr-1993  glass branches: 1.1.1;
tail from ftp.uu.net:bsd-sources integrated
 1.1.1.1 23-Nov-1994  jtc imported from 4.4lite
 1.10 03-Sep-2011  christos 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.
 1.9 13-Apr-2009  lukem 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
 1.8 16-Feb-2004  itojun branches: 1.8.42;
do not use long for file offset, use off_t. otto@openbsd
 1.7 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.6 14-Jun-2002  wiz Remove #if __STDC__. De-__P() and ANSIfy.
 1.5 11-Oct-2000  is More format string cleanup by sommerfeld.
 1.4 21-Jul-1999  cgd branches: 1.4.8;
avoid repeated error messages by making bytes(), lines() and rlines() return
meaningful values, which can then be checked to avoid another error message.
 1.3 23-Nov-1994  jtc branches: 1.3.8;
Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 30-Apr-1993  glass branches: 1.1.1;
tail from ftp.uu.net:bsd-sources integrated
 1.1.1.1 23-Nov-1994  jtc imported from 4.4lite
 1.3.8.2 19-Oct-2000  he Pull up revision 1.5 (requested by he):
Format string cleanup.
 1.3.8.1 20-Aug-1999  cgd pull up rev 1.4 from trunk. (cgd)
 1.4.8.1 18-Oct-2000  tv Pullup usr.bin string format fixes [is].
See "cvs log" for explicit revision numbers per file, from sommerfeld.
 1.8.42.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.34 14-Jan-2024  christos PR/57850: Ricardo Branco: tail does not work in some pseudo-filesystems
From FreeBSD: https://github.com/NetBSD/src/pull/20
 1.33 09-Oct-2015  christos 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.
 1.32 18-Oct-2013  christos fix unused variable warnings
 1.31 03-Sep-2011  christos branches: 1.31.2; 1.31.8;
minor knf, no functional change.
 1.30 03-Sep-2011  christos 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.
 1.29 13-Apr-2009  lukem 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
 1.28 24-May-2006  christos branches: 1.28.28;
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.
 1.27 02-Jun-2005  lukem branches: 1.27.2;
appease gcc -Wuninitialized
 1.26 16-Feb-2004  itojun do not use long for file offset, use off_t. otto@openbsd
 1.25 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.24 10-Mar-2003  lukem 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.
 1.23 30-Oct-2002  jdolecek 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
 1.22 18-Sep-2002  skrll Update error message after recent changes.
 1.21 18-Sep-2002  mycroft Remove an old comment.
 1.20 18-Sep-2002  mycroft select() -> nanosleep()
 1.19 14-Jun-2002  wiz Remove #if __STDC__. De-__P() and ANSIfy.
 1.18 24-Nov-2001  explorer fix tail; don't try to map more of the file than really exists
 1.17 21-Nov-2001  explorer 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.
 1.16 21-Jul-1999  cgd avoid repeated error messages by making bytes(), lines() and rlines() return
meaningful values, which can then be checked to avoid another error message.
 1.15 19-Dec-1998  christos branches: 1.15.2;
KNF
 1.14 03-Nov-1998  christos Pacify gcc-2.8.1 (extra braces).
 1.13 18-Sep-1998  cjs Remove tracking of file size by how many characters were output.
This succumbs to a race condition where data are written to the
file while the sleep is occurring. If a stat is done immediately
after, lastsize is updated but the file pointer wasn't pointing at
the end of the file, so the number of bytes between the current
pointer and the end of the file is added to the lastsize when
lastsize already points to the end of the file.
 1.12 20-Feb-1998  mycroft Use MAP_SHARED, not MAP_PRIVATE.
 1.11 17-Feb-1998  augustss Add MAP_FILE as well.
 1.10 17-Feb-1998  augustss Make sure mmap() uses MAP_PRIVATE instead of 0.
 1.9 09-Feb-1998  cjs Add -F option to follow files though rotations and truncations.
 1.8 19-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register, getopt returns -1 not EOF
 1.7 13-Feb-1996  ghudson Don't rely on select() not to modify the timeval argument. Also,
simplify the code by passing in NULL rather than an empty fd_set to
indicate no file descriptors.
 1.6 23-Nov-1994  jtc Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
 1.5 23-Nov-1994  jtc munmap() mmap()ed regions.
 1.4 24-Apr-1994  deraadt various off_t fixes
 1.3 28-Mar-1994  cgd off_t foo, and MAP_FILE
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 30-Apr-1993  glass branches: 1.1.1;
tail from ftp.uu.net:bsd-sources integrated
 1.1.1.1 23-Nov-1994  jtc imported from 4.4lite
 1.15.2.1 20-Aug-1999  cgd pull up rev 1.16 from trunk. (cgd)
 1.27.2.1 19-Jun-2006  chap Sync with head.
 1.28.28.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.31.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.31.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.7 03-Sep-2011  christos 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.
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.5 14-Jun-2002  wiz Remove #if __STDC__. De-__P() and ANSIfy.
 1.4 19-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register, getopt returns -1 not EOF
 1.3 23-Nov-1994  jtc Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 30-Apr-1993  glass branches: 1.1.1;
tail from ftp.uu.net:bsd-sources integrated
 1.1.1.1 23-Nov-1994  jtc imported from 4.4lite
 1.17 03-Sep-2011  christos minor knf, no functional change.
 1.16 03-Sep-2011  christos 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.
 1.15 13-Apr-2009  lukem 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
 1.14 30-Sep-2008  dholland branches: 1.14.6;
Use off_t, not __off_t.
 1.13 04-Feb-2008  christos 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
 1.12 30-Apr-2006  christos branches: 1.12.12;
Coverity CID 2986: Free lines before returning.
 1.11 09-Apr-2006  christos Coverity CID 1563: Fix memory leak.
 1.10 16-Oct-2003  itojun safer use of realloc
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.8 14-Jun-2002  wiz Remove #if __STDC__. De-__P() and ANSIfy.
 1.7 21-Jul-1999  cgd avoid repeated error messages by making bytes(), lines() and rlines() return
meaningful values, which can then be checked to avoid another error message.
 1.6 03-Nov-1998  christos branches: 1.6.2;
explicitly zero the lines structure! How did this ever work before?
 1.5 19-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register, getopt returns -1 not EOF
 1.4 23-Nov-1994  jtc Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
 1.3 28-Mar-1994  cgd off_t foo, and MAP_FILE
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 30-Apr-1993  glass branches: 1.1.1;
tail from ftp.uu.net:bsd-sources integrated
 1.1.1.1 23-Nov-1994  jtc imported from 4.4lite
 1.6.2.1 20-Aug-1999  cgd pull up rev 1.7 from trunk. (cgd)
 1.12.12.1 23-Mar-2008  matt sync with HEAD
 1.14.6.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.23 03-Sep-2011  christos minor knf, no functional change.
 1.22 03-Sep-2011  christos leave the original errno as it was. don't report EFBIG on all mmap failures.
 1.21 03-Sep-2011  christos 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.
 1.20 13-Apr-2009  lukem 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
 1.19 09-Apr-2006  christos branches: 1.19.30;
Duh fixed error printing.
 1.18 09-Apr-2006  christos Coverity CID 1580: Plug memory leak.
 1.17 05-Jun-2005  chs appease gcc -Wuninitialized on hp700.
 1.16 16-Feb-2004  itojun do not use long for file offset, use off_t. otto@openbsd
 1.15 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.14 14-Jun-2002  wiz Remove #if __STDC__. De-__P() and ANSIfy.
 1.13 16-Jan-2001  cgd avoid C sequence point issues warned about by development version of gcc.
 1.12 04-Jan-2001  lukem use %ll_ instead of the less standard %q_
 1.11 21-Jul-1999  cgd avoid repeated error messages by making bytes(), lines() and rlines() return
meaningful values, which can then be checked to avoid another error message.
 1.10 20-Feb-1998  mycroft branches: 1.10.2;
Use MAP_SHARED, not MAP_PRIVATE.
 1.9 17-Feb-1998  augustss Add MAP_FILE as well.
 1.8 17-Feb-1998  augustss Make sure mmap() uses MAP_PRIVATE instead of 0.
 1.7 19-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register, getopt returns -1 not EOF
 1.6 23-Nov-1994  jtc Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
 1.5 23-Nov-1994  jtc munmap() mmap()ed regions.
 1.4 24-Apr-1994  deraadt various off_t fixes
 1.3 28-Mar-1994  cgd off_t foo, and MAP_FILE
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 30-Apr-1993  glass branches: 1.1.1;
tail from ftp.uu.net:bsd-sources integrated
 1.1.1.1 23-Nov-1994  jtc imported from 4.4lite
 1.10.2.1 20-Aug-1999  cgd pull up rev 1.11 from trunk. (cgd)
 1.19.30.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.3 20-Jun-2020  kamil Remove double 'each of'

Reported by Weitian LI liweitianux (DragonFly).
 1.2 01-Oct-2017  kre Remove some unnecessary words.
 1.1 01-Oct-2017  maya 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.
 1.21 28-Aug-2022  hgutch Change back various occurrences of \*[Le], \*[Ge] (less/greater equal)
and \*(ua (upwards arrow) to literal "<=", ">=" and "^" whenever
appropriate (e.g., in code examples).
 1.20 15-Oct-2017  pgoyette Nit-picking: avoid split infinitive
 1.19 02-Oct-2017  wiz Sort options.

-qv are not specific to -r, so separate them.
Add -q and -v descriptions to the general option table.
 1.18 01-Oct-2017  maya 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.
 1.17 04-Jul-2017  wiz Add EXIT STATUS section. Use Ex.
 1.16 03-Jul-2017  wiz Remove workaround for ancient HTML generation code.
 1.15 15-Jun-2014  wiz Fix -f description: it is also ignored if stdin is a FIFO.
From Philip Guenther via jmc@openbsd.
Bump date.
 1.14 31-Jan-2013  wiz branches: 1.14.6;
Add comma after i.e.
From Bug Hunting.
 1.13 07-Aug-2003  agc branches: 1.13.56; 1.13.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.12 25-Feb-2003  wiz .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
 1.11 08-Feb-2002  ross Generate <>& symbolically. I'm avoiding .../dist/... directories for now.
 1.10 08-Dec-2001  wiz Sort sections.
 1.9 01-Dec-2001  wiz Whitespace cleanup.
 1.8 22-Mar-1999  garbled 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.
 1.7 18-Sep-1998  cjs Add bugs section noting that, with -F, tail can fail to detect a file
truncation. Also note that -F option is an extension.
 1.6 09-Feb-1998  cjs Add -F option to follow files though rotations and truncations.
 1.5 19-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register, getopt returns -1 not EOF
 1.4 23-Nov-1994  jtc Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
 1.3 30-Nov-1993  jtc Use ".St -p1003.2-92" macro instead of spelling it out.
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 30-Apr-1993  glass branches: 1.1.1;
tail from ftp.uu.net:bsd-sources integrated
 1.1.1.1 23-Nov-1994  jtc imported from 4.4lite
 1.13.62.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.13.62.1 25-Feb-2013  tls resync with head
 1.13.56.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.6.1 10-Aug-2014  tls Rebase.
 1.21 07-Aug-2023  tnn tail: adjust misleading indentation in macro. NFC.
 1.20 06-Mar-2018  eadler [tail] Fix type of 'len'

ok pgoyette
 1.19 02-Oct-2017  wiz branches: 1.19.2;
Sort options.

-qv are not specific to -r, so separate them.
Add -q and -v descriptions to the general option table.
 1.18 01-Oct-2017  maya 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.
 1.17 31-Jan-2013  wiz Add comma after i.e.
From Bug Hunting.
 1.16 03-Sep-2011  christos branches: 1.16.2; 1.16.8;
minor knf, no functional change.
 1.15 03-Sep-2011  christos 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.
 1.14 13-Apr-2009  lukem 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
 1.13 21-Jul-2008  lukem branches: 1.13.6;
Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
 1.12 16-Feb-2004  itojun branches: 1.12.34;
do not use long for file offset, use off_t. otto@openbsd
 1.11 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.10 14-Jul-2003  itojun minor KNF
 1.9 14-Jun-2002  wiz Remove #if __STDC__. De-__P() and ANSIfy.
 1.8 29-Apr-2002  wiz Add -F to usage, per bin/16558 by Ryan Younce.
 1.7 25-Aug-1998  ross Add { and } to shut up egcs. Reformat the more questionable code.
 1.6 09-Feb-1998  cjs Add -F option to follow files though rotations and truncations.
 1.5 19-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register, getopt returns -1 not EOF
 1.4 23-Nov-1994  jtc Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
 1.3 24-Apr-1994  deraadt various off_t fixes
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 30-Apr-1993  glass branches: 1.1.1;
tail from ftp.uu.net:bsd-sources integrated
 1.1.1.1 23-Nov-1994  jtc imported from 4.4lite
 1.12.34.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.13.6.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.16.8.1 25-Feb-2013  tls resync with head
 1.16.2.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.19.2.1 15-Mar-2018  pgoyette Synch with HEAD

RSS XML Feed