ident
searches for all instances of the pattern
$keyword: text $
in the named files or, if no files are named, the standard input.
These patterns are normally inserted automatically by the RCS command
co(1),
but can also be inserted manually.
The option
-q
suppresses
the warning given if there are no patterns in a file.
The option
-V
prints
ident's
version number.
ident
works on text files as well as object files and dumps.
For example, if the C program in
f.c
contains
-
#include <stdio.h>
static char const rcsid[] =
"$Id: f.c,v 5.4 1993/11/09 17:40:15 eggert Exp $";
int main() { return printf("%s\n", rcsid) == EOF; }
and
f.c
is compiled into
f.o,
then the command
-
ident f.c f.o
will output
- f.c:
$Id: f.c,v 5.4 1993/11/09 17:40:15 eggert Exp $
f.o:
$Id: f.c,v 5.4 1993/11/09 17:40:15 eggert Exp $
If a C program defines a string like
rcsid
above but does not use it,
lint(1)
may complain, and some C compilers will optimize away the string.
The most reliable solution is to have the program use the
rcsid
string, as shown in the example above.
ident
finds all instances of the
$keyword: text $
pattern, even if
keyword
is not actually an RCS-supported keyword.
This gives you information about nonstandard keywords like
$XConsortium$.