Index: extern.h =================================================================== RCS file: /home/ncvs/src/usr.bin/tail/extern.h,v retrieving revision 1.9 diff -u -r1.9 extern.h --- extern.h 4 Nov 2004 19:18:19 -0000 1.9 +++ extern.h 29 Jun 2006 22:03:05 -0000 @@ -72,5 +72,5 @@ int mapprint(struct mapinfo *, off_t, off_t); int maparound(struct mapinfo *, off_t); -extern int Fflag, fflag, rflag, rval, no_files; +extern int Fflag, fflag, qflag, rflag, rval, no_files; extern const char *fname; Index: forward.c =================================================================== RCS file: /home/ncvs/src/usr.bin/tail/forward.c,v retrieving revision 1.39 diff -u -r1.39 forward.c --- forward.c 26 Aug 2005 08:15:57 -0000 1.39 +++ forward.c 29 Jun 2006 22:03:05 -0000 @@ -249,7 +249,8 @@ while ((ch = getc(file->fp)) != EOF) { if (last != file && no_files > 1) { - (void)printf("\n==> %s <==\n", file->file_name); + if (!qflag) + (void)printf("\n==> %s <==\n", file->file_name); last = file; } if (putchar(ch) == EOF) @@ -322,7 +323,7 @@ if (file->fp) { active = 1; n++; - if (no_files > 1) + if (no_files > 1 && !qflag) (void)printf("\n==> %s <==\n", file->file_name); forward(file->fp, style, off, &file->st); if (Fflag && fileno(file->fp) != STDIN_FILENO) Index: tail.1 =================================================================== RCS file: /home/ncvs/src/usr.bin/tail/tail.1,v retrieving revision 1.12 diff -u -r1.12 tail.1 --- tail.1 17 Jan 2005 07:44:30 -0000 1.12 +++ tail.1 29 Jun 2006 22:03:05 -0000 @@ -35,7 +35,7 @@ .\" @(#)tail.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD: src/usr.bin/tail/tail.1,v 1.12 2005/01/17 07:44:30 ru Exp $ .\" -.Dd June 6, 1993 +.Dd June 29, 2006 .Dt TAIL 1 .Os .Sh NAME @@ -49,6 +49,9 @@ .Fl r .Oc .Oo +.Fl q +.Oc +.Oo .Fl b Ar number | .Fl c Ar number | .Fl n Ar number @@ -114,6 +117,8 @@ The location is .Ar number lines. +.It Fl q +Suppresses printing of headers when multiple files are being examined. .It Fl r The .Fl r @@ -139,7 +144,9 @@ .Dq ==> XXX <== where .Dq XXX -is the name of the file. +is the name of the file unless +.Fl q +flag is specified. .Sh EXIT STATUS .Ex -std .Sh SEE ALSO Index: tail.c =================================================================== RCS file: /home/ncvs/src/usr.bin/tail/tail.c,v retrieving revision 1.21 diff -u -r1.21 tail.c --- tail.c 1 Jun 2005 20:34:06 -0000 1.21 +++ tail.c 29 Jun 2006 22:03:05 -0000 @@ -60,7 +60,7 @@ #include "extern.h" -int Fflag, fflag, rflag, rval, no_files; +int Fflag, fflag, qflag, rflag, rval, no_files; const char *fname; file_info_t *files; @@ -114,7 +114,7 @@ obsolete(argv); style = NOTSET; - while ((ch = getopt(argc, argv, "Fb:c:fn:r")) != -1) + while ((ch = getopt(argc, argv, "Fb:c:fn:qr")) != -1) switch(ch) { case 'F': /* -F is superset of (and implies) -f */ Fflag = fflag = 1; @@ -131,6 +131,9 @@ case 'n': ARG(1, FLINES, RLINES); break; + case 'q': + qflag = 1; + break; case 'r': rflag = 1; break; @@ -199,7 +202,7 @@ ierr(); continue; } - if (argc > 1) { + if (argc > 1 && !qflag) { (void)printf("%s==> %s <==\n", first ? "" : "\n", fname); first = 0;