what(1) what(1)
Version 1.3 Version 1.3
NAME
what - display information from a program
SYNOPSIS
what file ...
what -v
DESCRIPTION
what is a program to display copyright or version information from a
binary or ASCII file. It provides an easy way to obtain informations
from any type of files if a special string sequence is included in the
file. Every patch applied to a file should add a such a line
identifying itself in the file. This makes it easy to identify the
patchlevel.
what searches for the special four character string sequence @(#) and
writes all subsequent characters up to one of the five special
terminating characters " > \ \0 \n or EOF to stdout.
Multiple occurrencies of a @(#) sequence will be found in one file.
OPTIONS
-v option prints the version of the what program itself.
DIAGNOSTICS
On usage error, exit status is 1. If all files could be successfully
processed, what exits with 0. For every file not successfuly
processed (could not be opened) exit status is incremented by 1.
EXAMPLE
A typical sequence in a C program myprog.c might look like:
char *what="@(#) myprog version 1.0 (c) myself";
Running what on the source file, object file and the executable gives:
$ what myprog.c myprog.o myprog
myprog.c:
myprog version 1.0 (c) myself
myprog.o:
myprog version 1.0 (c) myself
myprog:
myprog version 1.0 (c) myself
The what sequence may also be useful in shell scripts or other
- 1 - Formatted: December 16, 2025
what(1) what(1)
Version 1.3 Version 1.3
textfiles like configuration files or binary data files.
ORIGIN
The idea of this program came from the what utility of the SCCS
(source code control system), but it is completely written without any
knowledge of the original code.
Another idea of identifying files may be found in the ident program
from the Revision Control System (RCS) which however uses different
identification strings.
AUTHOR
andreas_bagge@maush2.han.de (Andreas Bagge).
The source code and the executable binary may be distributed under the
GNU General Public Licence (GPL).
SEE ALSO
ident(1), rcs(1), sccs(1)
- 2 - Formatted: December 16, 2025