summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorAndy Fiddaman <omnios@citrus-it.co.uk>2022-02-23 11:09:07 +0000
committerAndy Fiddaman <omnios@citrus-it.co.uk>2022-03-02 15:22:03 +0000
commitd2b76ef70a19a09ea9aab5aaeb614dc7c9d195ed (patch)
tree8480f416659f3c60402bb4242a5e3fe0158f706d /usr/src
parent63cdc4a2836cf93078a5dd140d42583170a04953 (diff)
downloadillumos-gate-d2b76ef70a19a09ea9aab5aaeb614dc7c9d195ed.tar.gz
14534 diff could support -q
Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Robert Mustacchi <rm@fingolfin.org>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/diff/Makefile1
-rw-r--r--usr/src/cmd/diff/diff.c27
-rw-r--r--usr/src/cmd/diff/diff.h10
-rw-r--r--usr/src/man/man1/diff.1850
4 files changed, 443 insertions, 445 deletions
diff --git a/usr/src/cmd/diff/Makefile b/usr/src/cmd/diff/Makefile
index 02f8655486..a3d6ac51aa 100644
--- a/usr/src/cmd/diff/Makefile
+++ b/usr/src/cmd/diff/Makefile
@@ -31,7 +31,6 @@ LIBDIFFH= diffh
include ../Makefile.cmd
CERRWARN += -_gcc=-Wno-parentheses
-CERRWARN += -_gcc=-Wno-address
#
# for messaging catalog
diff --git a/usr/src/cmd/diff/diff.c b/usr/src/cmd/diff/diff.c
index 5a2ae27492..16a3f3b06d 100644
--- a/usr/src/cmd/diff/diff.c
+++ b/usr/src/cmd/diff/diff.c
@@ -38,6 +38,10 @@
*/
/*
+ * Copyright 2022 OmniOS Community Edition (OmniOSce) Association.
+ */
+
+/*
* diff - differential file comparison
*
* Uses an algorithm which finds
@@ -232,7 +236,7 @@ main(int argc, char **argv)
diffargv = argv;
whichtemp = 0;
- while ((flag = getopt(argc, argv, "bitwcuefhnlrsC:D:S:U:")) != EOF) {
+ while ((flag = getopt(argc, argv, "bitwcuefhnlqrsC:D:S:U:")) != EOF) {
switch (flag) {
case 'D':
opt = D_IFDEF;
@@ -294,6 +298,10 @@ main(int argc, char **argv)
opt = D_NREVERSE;
break;
+ case 'q':
+ qflag = 1;
+ break;
+
case 'r':
rflag = 1;
break;
@@ -462,6 +470,13 @@ notsame:
(void) fclose(input[1]);
done();
}
+ if (qflag) {
+ (void) printf(gettext("Files %s and %s differ\n"),
+ file1, file2);
+ (void) fclose(input[0]);
+ (void) fclose(input[1]);
+ done();
+ }
prepare(0, file1);
prepare(1, file2);
prune();
@@ -1796,7 +1811,7 @@ useless(char *cp)
if (cp[1] == '.' && cp[2] == '\0')
return (1); /* directory ".." */
}
- if (start && strcmp(start, cp) > 0)
+ if (strcmp(start, cp) > 0)
return (1);
return (0);
}
@@ -2041,11 +2056,11 @@ static void
usage(void)
{
(void) fprintf(stderr, gettext(
- "usage: diff [-bitw] [-c | -e | -f | -h | -n | -u] file1 "
+ "usage: diff [-biqtw] [-c | -e | -f | -h | -n | -u] file1 "
"file2\n"
- " diff [-bitw] [-C number | -U number] file1 file2\n"
- " diff [-bitw] [-D string] file1 file2\n"
- " diff [-bitw] [-c | -e | -f | -h | -n | -u] [-l] [-r] "
+ " diff [-biqtw] [-C number | -U number] file1 file2\n"
+ " diff [-biqtw] [-D string] file1 file2\n"
+ " diff [-biqtw] [-c | -e | -f | -h | -n | -u] [-l] [-r] "
"[-s] [-S name] directory1 directory2\n"));
status = 2;
done();
diff --git a/usr/src/cmd/diff/diff.h b/usr/src/cmd/diff/diff.h
index 3bc71686ec..420e7726a5 100644
--- a/usr/src/cmd/diff/diff.h
+++ b/usr/src/cmd/diff/diff.h
@@ -25,7 +25,7 @@
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
@@ -37,12 +37,13 @@
* contributors.
*/
+/*
+ * Copyright 2022 OmniOS Community Edition (OmniOSce) Association.
+ */
+
#ifndef _DIFF_H
#define _DIFF_H
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -123,6 +124,7 @@ int bflag = 0;
int tflag = 0;
int wflag = 0;
int iflag = 0;
+int qflag = 0;
int rflag = 0;
int lflag = 0;
int sflag = 0;
diff --git a/usr/src/man/man1/diff.1 b/usr/src/man/man1/diff.1
index b3f54b09cb..5078d84803 100644
--- a/usr/src/man/man1/diff.1
+++ b/usr/src/man/man1/diff.1
@@ -43,455 +43,437 @@
.\" Copyright 1989 AT&T
.\" Portions Copyright (c) 1992, X/Open Company Limited. All Rights Reserved.
.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright 2022 OmniOS Community Edition (OmniOSce) Association.
.\"
-.TH DIFF 1 "Sep 22, 2004"
-.SH NAME
-diff \- compare two files
-.SH SYNOPSIS
-.LP
-.nf
-\fBdiff\fR [\fB-bitw\fR] [\fB-c\fR | \fB-e\fR | \fB-f\fR | \fB-h\fR | \fB-n\fR | \fB-u\fR] \fIfile1\fR \fIfile2\fR
-.fi
-
-.LP
-.nf
-\fBdiff\fR [\fB-bitw\fR] [\fB-C\fR \fInumber\fR | \fB-U\fR \fInumber\fR] \fIfile1\fR \fIfile2\fR
-.fi
-
-.LP
-.nf
-\fBdiff\fR [\fB-bitw\fR] [\fB-D\fR \fIstring\fR] \fIfile1\fR \fIfile2\fR
-.fi
-
-.LP
-.nf
-\fBdiff\fR [\fB-bitw\fR] [\fB-c\fR | \fB-e\fR | \fB-f\fR | \fB-h\fR | \fB-n\fR | \fB-u\fR] [\fB-l\fR] [\fB-r\fR] [\fB-s\fR]
- [\fB-S\fR \fIname\fR] \fIdirectory1\fR \fIdirectory2\fR
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-The \fBdiff\fR utility will compare the contents of \fIfile1\fR and \fIfile2\fR
-and write to standard output a list of changes necessary to convert \fIfile1\fR
-into \fIfile2\fR. This list should be minimal. Except in rare circumstances,
-\fBdiff\fR finds a smallest sufficient set of file differences. No output will
-be produced if the files are identical.
-.sp
-.LP
+.Dd February 23, 2022
+.Dt DIFF 1
+.Os
+.Sh NAME
+.Nm diff
+.Nd compare two files
+.Sh SYNOPSIS
+.Nm
+.Op Fl biqtw
+.Op Fl c | e | f | h | n | u
+.Ar file1
+.Ar file2
+.Nm
+.Op Fl biqtw
+.Op Fl C Ar number | Fl U Ar number
+.Ar file1
+.Ar file2
+.Nm
+.Op Fl biqtw
+.Op Fl D Ar string
+.Ar file1
+.Ar file2
+.Nm
+.Op Fl biqtw
+.Op Fl c | e | f | h | n | u
+.Op Fl l
+.Op Fl r
+.Op Fl s
+.Op Fl S Ar name
+.Ar directory1
+.Ar directory2
+.Sh DESCRIPTION
+The
+.Nm
+utility will compare the contents of
+.Ar file1
+and
+.Ar file2
+and write to standard output a list of changes necessary to convert
+.Ar file1
+into
+.Ar file2 .
+This list should be minimal.
+Except in rare circumstances,
+.Nm
+finds a smallest sufficient set of file differences.
+No output will be produced if the files are identical.
+.Pp
The normal output contains lines of these forms:
-.sp
-.in +2
-.nf
-\fIn1\fR \fBa\fR \fIn3,n4\fR
-\fIn1,n2\fR \fBd\fR \fIn3\fR
-\fIn1,n2\fR \fBc\fR \fIn3,n4\fR
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-where \fIn1\fR and \fIn2\fR represent lines \fIfile1\fR and \fIn3\fR and
-\fIn4\fR represent lines in \fIfile2\fR These lines resemble \fBed\fR(1)
-commands to convert \fIfile1\fR to \fIfile2\fR. By exchanging \fBa\fR for
-\fBd\fR and reading backward, \fIfile2\fR can be converted to \fIfile1\fR. As
-in \fBed\fR, identical pairs, where \fIn1\fR=\fIn2\fR or \fIn3\fR=\fIn4\fR, are
-abbreviated as a single number.
-.sp
-.LP
+.Pp
+.Bl -item -offset indent -compact
+.Sm off
+.It
+.Ar n1 Sy a Ar n3 , n4
+.It
+.Ar n1 , n2 Sy d Ar n3
+.It
+.Ar n1 , n2 Sy c Ar n3 , n4
+.Sm on
+.El
+.Pp
+where
+.Ar n1
+and
+.Ar n2
+represent lines in
+.Ar file1
+and
+.Ar n3
+and
+.Ar n4
+represent lines in
+.Ar file2
+These lines resemble
+.Xr ed 1
+commands to convert
+.Ar file1
+to
+.Ar file2 .
+By exchanging
+.Sy a
+for
+.Sy d
+and reading backwards,
+.Ar file2
+can be converted to
+.Ar file1 .
+As in
+.Xr ed 1 ,
+identical pairs, where
+.Ar n1 Ns = Ns Ar n2
+or
+.Ar n3 Ns = Ns Ar n4
+are abbreviated as a single number.
+.Pp
Following each of these lines come all the lines that are affected in the first
-file flagged by `\|\fB<\fR\|', then all the lines that are affected in the
-second file flagged by `\|\fB>\fR\|'.
-.SH OPTIONS
-.sp
-.LP
+file flagged by
+.Sq < ,
+then all the lines that are affected in the second file flagged by
+.Sq > .
+.Sh OPTIONS
The following options are supported:
-.sp
-.ne 2
-.na
-\fB\fB-b\fR \fR
-.ad
-.RS 7n
-Ignores trailing blanks (spaces and tabs) and treats other strings of blanks as
-equivalent.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-i\fR \fR
-.ad
-.RS 7n
-Ignores the case of letters. For example, `\fBA\fR' will compare equal to
-`\fBa\fR'.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-t\fR \fR
-.ad
-.RS 7n
-Expands TAB characters in output lines. Normal or \fB-c\fR output adds
-character(s) to the front of each line that may adversely affect the
-indentation of the original source lines and make the output lines difficult to
-interpret. This option will preserve the original source's indentation.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-w\fR \fR
-.ad
-.RS 7n
-Ignores all blanks (SPACE and TAB characters) and treats all other strings of
-blanks as equivalent. For example, `\fBif ( a =\|= b )\fR' will compare equal
-to `\fBif(a=\|=b)\fR'.
-.RE
-
-.sp
-.LP
+.Bl -tag -width Ds
+.It Fl b
+Ignores trailing blanks
+.Pq spaces and tabs
+and treats other strings of blanks as equivalent.
+.It Fl i
+Ignores the case of letters.
+For example, `
+.Sq A
+will compare equal to
+.Sq a .
+.It Fl q
+report only when files differ
+.It Fl t
+Expands TAB characters in output lines.
+Normal or
+.Fl c
+output adds character(s) to the front of each line that may adversely affect
+the indentation of the original source lines and make the output lines
+difficult to interpret.
+This option will preserve the original source's indentation.
+.It Fl w
+Ignores all blanks
+.Pq SPACE and TAB characters
+and treats all other strings of blanks as equivalent.
+For example,
+.Ql if ( a == b )
+will compare equal to
+.Ql if (a==b) .
+.El
+.Pp
The following options are mutually exclusive:
-.sp
-.ne 2
-.na
-\fB\fB-c\fR \fR
-.ad
-.RS 14n
-Produces a listing of differences with three lines of context. With this
-option, output format is modified slightly. That is, output begins with
-identification of the files involved and their creation dates, then each change
-is separated by a line with a dozen \fB*\fR's. The lines removed from
-\fIfile1\fR are marked with '\(em'. The lines added to \fIfile2\fR are
-marked '\|+\|'. Lines that are changed from one file to the other are marked in both
-files with '\|!\|'.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-C\fR \fInumber\fR \fR
-.ad
-.RS 14n
-Produces a listing of differences identical to that produced by \fB-c\fR with
-\fInumber\fR lines of context.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-D\fR \fIstring\fR \fR
-.ad
-.RS 14n
-Creates a merged version of \fIfile1\fR and \fIfile2\fR with C preprocessor
-controls included so that a compilation of the result without defining
-\fIstring\fR is equivalent to compiling \fIfile1\fR, while defining
-\fIstring\fR will yield \fIfile2\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-e\fR \fR
-.ad
-.RS 14n
-Produces a script of only \fBa\fR, \fBc\fR, and \fBd\fR commands for the editor
-\fBed\fR, which will recreate \fIfile2\fR from \fIfile1\fR. In connection with
-the \fB-e\fR option, the following shell program may help maintain multiple
-versions of a file. Only an ancestral file ($1) and a chain of
-version-to-version \fBed\fR scripts ($2,$3,...) made by \fBdiff\fR need be on
-hand. A ``latest version'' appears on the standard output.
-.sp
-.in +2
-.nf
-(shift; cat $*; echo a\'1,$p') | ed \(mi $1
-.fi
-.in -2
-.sp
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-f\fR \fR
-.ad
-.RS 13n
-Produces a similar script, not useful with \fBed\fR, in the opposite order.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-h\fR \fR
-.ad
-.RS 13n
-Does a fast, half-hearted job. It works only when changed stretches are short
-and well separated, but does work on files of unlimited length. Options
-\fB-c\fR, \fB-C\fR, \fB-D\fR, \fB-e\fR, \fB-f\fR, and \fB-n\fR are unavailable
-with \fB-h\fR. \fBdiff\fR does not descend into directories with this option.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-n\fR \fR
-.ad
-.RS 13n
-Produces a script similar to \fB-e\fR, but in the opposite order and with a
-count of changed lines on each insert or delete command.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-u\fR\fR
-.ad
-.RS 13n
-Produces a listing of differences with three lines of context. The output is
-similar to that of the \fB-c\fR option, except that the context is "unified".
-Removed and changed lines in \fIfile1\fR are marked by a '\fB-\fR' while lines
-added or changed in \fIfile2\fR are marked by a '\fB+\fR'. Both versions of
-changed lines appear in the output, while added, removed, and context lines
-appear only once. The identification of \fIfile1\fR and \fIfile2\fR is
-different, with "\fB\(mi\(mi\(mi\fR" and "\fB+++\fR" being printed where
-"\fB***\fR" and "\fB\(mi\(mi\(mi\fR" would appear with the \fB-c\fR option.
+.Bl -tag -width Ds
+.It Fl c
+Produces a listing of differences with three lines of context.
+With this option, output format is modified slightly.
+That is, output begins with identification of the files involved and their
+creation dates, then each change is separated by a line with a dozen
+asterisks
+.Pq \&* .
+The lines removed from
+.Ar file1
+are marked with
+.Sq -- .
+The lines added to
+.Ar file2
+are marked
+.Sq \&+ .
+Lines that are changed from one file to the other are marked in both files with
+.Sq \&! .
+.It Fl C Ar number
+Produces a listing of differences identical to that produced by
+.Fl c
+with
+.Ar number
+lines of context.
+.It Fl D Ar string
+Creates a merged version of
+.Ar file1
+and
+.Ar file2
+with C preprocessor controls included so that a compilation of the result
+without defining
+.Ar string
+is equivalent to compiling
+.Ar file1 ,
+while defining
+.Ar string
+will yield
+.Ar file2 .
+.It Fl e
+Produces a script of only
+.Sy a ,
+.Sy c ,
+and
+.Sy d
+commands for the editor
+.Xr ed 1 ,
+which will recreate
+.Ar file2
+from
+.Ar file1 .
+In connection with the
+.Fl e
+option, the following shell program may help maintain multiple versions of a
+file.
+Only an ancestral file
+.Pq $1
+and a chain of version-to-version
+.Sy ed
+scripts
+.Pq $2,$3,...
+made by
+.Nm
+need be on hand.
+A
+.Dq latest version
+appears on the standard output.
+.Pp
+.Dl (shift; cat $*; echo a'1,$p') | ed - $1
+.It Fl f
+Produces a similar script, not useful with
+.Xr ed 1 ,
+in the opposite order.
+.It Fl h
+Does a fast, half-hearted job.
+It works only when changed stretches are short and well separated, but does
+work on files of unlimited length.
+Options
+.Fl c ,
+.Fl C ,
+.Fl D ,
+.Fl e ,
+.Fl f ,
+and
+.Fl n
+are unavailable with
+.Fl h .
+.Nm
+does not descend into directories with this option.
+.It Fl n
+Produces a script similar to
+.Fl e ,
+but in the opposite order and with a count of changed lines on each insert or
+delete command.
+.It Fl u
+Produces a listing of differences with three lines of context.
+The output is similar to that of the
+.Fl c
+option, except that the context is
+.Dq unified .
+Removed and changed lines in
+.Ar file1
+are marked by a
+.Sq \&-
+while lines added or changed in
+.Ar file2
+are marked by a
+.Sq \&+ .
+Both versions of changed lines appear in the output, while added, removed, and
+context lines appear only once.
+The identification of
+.Ar file1
+and
+.Ar file2
+is different, with
+.Dq ---
+and
+.Dq +++
+being printed where
+.Dq ***
+and
+.Dq ---
+would appear with the
+.Fl c
+option.
Each change is separated by a line of the form
-.sp
-.in +2
-.nf
-\fB@@ -\fIn1\fR,\fIn2\fR +\fIn3\fR,\fIn4\fR @@\fR
-.fi
-.in -2
-.sp
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-U\fR \fInumber\fR\fR
-.ad
-.RS 13n
-Produces a listing of differences identical to that produced by \fB-u\fR with
-\fInumber\fR lines of context.
-.RE
-
-.sp
-.LP
+.Pp
+.D1 Cm @@ Cm \&- Ns Ar n1 , Ns Ar n2 Cm + Ns Ar n3 , Ns Ar n4 Cm @@
+.It Fl U Ar number
+Produces a listing of differences identical to that produced by
+.Fl u
+with
+.Ar number
+lines of context.
+.El
+.Pp
The following options are used for comparing directories:
-.sp
-.ne 2
-.na
-\fB\fB-l\fR \fR
-.ad
-.RS 12n
-Produces output in long format. Before the \fBdiff\fR, each text file is piped
-through \fBpr\fR(1) to paginate it. Other differences are remembered and
-summarized after all text file differences are reported.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-r\fR \fR
-.ad
-.RS 12n
-Applies \fBdiff\fR recursively to common subdirectories encountered.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-s\fR \fR
-.ad
-.RS 12n
-Reports files that are identical. These identical files would not otherwise be
-mentioned.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-S\fR \fIname\fR \fR
-.ad
-.RS 12n
-Starts a directory \fBdiff\fR in the middle, beginning with the file
-\fIname\fR.
-.RE
-
-.SH OPERANDS
-.sp
-.LP
+.Bl -tag -width Ds
+.It Fl l
+Produces output in long format.
+Before the
+.Nm ,
+each text file is piped through
+.Xr pr 1
+to paginate it.
+Other differences are remembered and summarized after all text file differences
+are reported.
+.It Fl r
+Applies
+.Nm
+recursively to common subdirectories encountered.
+.It Fl s
+Reports files that are identical.
+These identical files would not otherwise be mentioned.
+.It Fl S Ar name
+Starts a directory
+.Nm
+in the middle, beginning with the file
+.Ar name .
+.El
+.Sh OPERANDS
The following operands are supported:
-.sp
-.ne 2
-.na
-\fB\fIfile1\fR \fR
-.ad
-.br
-.na
-\fB\fIfile2\fR\fR
-.ad
-.RS 15n
-A path name of a file or directory to be compared. If either \fIfile1\fR or
-\fIfile2\fR is \fB\(mi\fR, the standard input will be used in its place.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fIdirectory1\fR \fR
-.ad
-.br
-.na
-\fB\fIdirectory2\fR\fR
-.ad
-.RS 15n
+.Pp
+.Bl -tag -offset Ds -width directory1 -compact
+.It Ar file1
+.It Ar file2
+A path name of a file or directory to be compared.
+If either
+.Ar file1
+or
+.Ar file2
+is
+.Sq \&- ,
+the standard input will be used in its place.
+.Pp
+.It Ar directory1
+.It Ar directory2
A path name of a directory to be compared.
-.RE
-
-.sp
-.LP
-If only one of \fIfile1\fR and \fIfile2\fR is a directory, \fBdiff\fR will be
-applied to the non-directory file and the file contained in the directory file
-with a filename that is the same as the last component of the non-directory
-file.
-.SH USAGE
-.sp
-.LP
-See \fBlargefile\fR(5) for the description of the behavior of \fBdiff\fR when
-encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
-.SH EXAMPLES
-.LP
-\fBExample 1 \fRTypical output of the diff command
-.sp
-.LP
-In the following command, \fBdir1\fR is a directory containing a directory
-named \fBx\fR, \fBdir2\fR is a directory containing a directory named \fBx\fR,
-\fBdir1/x\fR and \fBdir2/x\fR both contain files named \fBdate.out\fR, and
-\fBdir2/x\fR contains a file named \fBy\fR:
-
-.sp
-.in +2
-.nf
-example% \fBdiff -r dir1 dir2\fR
+.El
+.Pp
+If only one of
+.Ar file1
+and
+.Ar file2
+is a directory,
+.Nm
+will be applied to the non-directory file and the file contained in the
+directory file with a filename that is the same as the last component of the
+non-directory file.
+.Sh USAGE
+See
+.Xr largefile 5
+for the description of the behavior of
+.Nm
+when encountering files greater than or equal to 2 Gbyte
+.Pq 2^31 bytes .
+.Sh FILES
+.Bl -tag -width Ds
+.It Pa /tmp/d?????
+temporary file used for comparison
+.It Pa /usr/lib/diffh
+executable file for
+.Fl h
+option
+.El
+.Sh EXIT STATUS
+The following exit values are returned:
+.Bl -tag -width Ds
+.It 0
+No differences were found.
+.It 1
+Differences were found.
+.It >1
+An error occurred.
+.El
+.Sh EXAMPLES
+.Sy Example 1 No Typical output of the diff command
+.Pp
+In the following command,
+.Ar dir1
+is a directory containing a directory named
+.Pa x ,
+.Ar dir2
+is a directory containing a directory named
+.Pa x ,
+.Pa dir1/x
+and
+.Pa dir2/x
+both contain files named
+.Pa date.out ,
+and
+.Pa dir2/x
+contains a file named
+.Pa y :
+.Bd -literal -offset 4n
+example% diff -r dir1 dir2
Common subdirectories: dir1/x and dir2/x
-
Only in dir2/x: y
-
diff -r dir1/x/date.out dir2/x/date.out
-
1c1
-
< Mon Jul 2 13:12:16 PDT 1990
-
---
-
> Tue Jun 19 21:41:39 PDT 1990
-.fi
-.in -2
-.sp
-
-.SH ENVIRONMENT VARIABLES
-.sp
-.LP
-See \fBenviron\fR(5) for descriptions of the following environment variables
-that affect the execution of \fBdiff\fR: \fBLANG\fR, \fBLC_ALL\fR,
-\fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, \fBLC_TIME\fR, and \fBNLSPATH\fR.
-.sp
-.ne 2
-.na
-\fB\fBTZ\fR \fR
-.ad
-.RS 7n
+.Ed
+.Sh ENVIRONMENT VARIABLES
+See
+.Xr environ 5
+for descriptions of the following environment variables that affect the
+execution of
+.Nm :
+.Ev LANG ,
+.Ev LC_ALL ,
+.Ev LC_CTYPE ,
+.Ev LC_MESSAGES ,
+.Ev LC_TIME ,
+and
+.Ev NLSPATH .
+.Bl -tag -width Ds
+.It Ev TZ
Determines the locale for affecting the timezone used for calculating file
-timestamps written with the \fB-C\fR and \fB-c\fR options.
-.RE
-
-.SH EXIT STATUS
-.sp
-.LP
-The following exit values are returned:
-.sp
-.ne 2
-.na
-\fB\fB0\fR \fR
-.ad
-.RS 7n
-No differences were found.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB1\fR \fR
-.ad
-.RS 7n
-Differences were found.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB>1\fR \fR
-.ad
-.RS 7n
-An error occurred.
-.RE
-
-.SH FILES
-.sp
-.ne 2
-.na
-\fB\fB/tmp/d?????\fR \fR
-.ad
-.RS 19n
-temporary file used for comparison
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB/usr/lib/diffh\fR \fR
-.ad
-.RS 19n
-executable file for \fB-h\fR option
-.RE
-
-.SH ATTRIBUTES
-.sp
-.LP
-See \fBattributes\fR(5) for descriptions of the following attributes:
-.sp
-
-.sp
-.TS
-box;
-c | c
-l | l .
-ATTRIBUTE TYPE ATTRIBUTE VALUE
-_
-CSI Enabled
-_
-Interface Stability Standard
-.TE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBbdiff\fR(1), \fBcmp\fR(1), \fBcomm\fR(1), \fBdircmp\fR(1), \fBed\fR(1),
-\fBpr\fR(1), \fBsdiff\fR(1), \fBattributes\fR(5), \fBenviron\fR(5),
-\fBlargefile\fR(5), \fBstandards\fR(5)
-.SH NOTES
-.sp
-.LP
-Editing scripts produced under the \fB-e\fR or \fB-f\fR options are naive about
-creating lines consisting of a single period (\fB\&.\fR).
-.sp
-.LP
+timestamps written with the
+.Fl C
+and
+.Fl c
+options.
+.El
+.Sh INTERFACE STABILITY
+The command line interface of
+.Nm
+is
+.Sy Committed .
+The output of
+.Nm
+is
+.Sy Committed .
+.Sh SEE ALSO
+.Xr bdiff 1 ,
+.Xr cmp 1 ,
+.Xr comm 1 ,
+.Xr dircmp 1 ,
+.Xr ed 1 ,
+.Xr pr 1 ,
+.Xr sdiff 1 ,
+.Xr attributes 5 ,
+.Xr environ 5 ,
+.Xr largefile 5 ,
+.Xr standards 5
+.Sh NOTES
+Editing scripts produced under the
+.Fl e
+or
+.Fl f
+options are na\(:ive about creating lines consisting of a single dot
+.Sq \&. .
+.Pp
Missing NEWLINE at end of file indicates that the last line of the file in
-question did not have a NEWLINE. If the lines are different, they will be
-flagged and output, although the output will seem to indicate they are the
-same.
+question did not have a NEWLINE.
+If the lines are different, they will be flagged and output, although the
+output will seem to indicate they are the same.