what - extract version information from a file
-s ] filename ...
what searches each filename for occurrences of the pattern @(#) that the SCCS get command substitutes for the %Z% ID keyword, and prints what follows up to a ", >, NEWLINE, \, or null character. What can be used on any type of file, NOT just SCCS files. Just put the magic 4 character @(#) pattern in your file and you are set.
-s Stop after the first occurrence of the pattern.
The working of what is not influenced by any environment variables.
If a Perl program test1.pl contains:
my $REV = '@(# ) $Revision: 1.3 ...
and a C program test2.c contains:
char rcsid = "@(# ) $Revision: 1.15 ....
and the C program is compiled to a.out...
prompt%> what test1.pl test2.c a.out
test1.pl: $Revision: 1.3 $';
test2.c: $Revision: 1.15 $";
a.out; $Revision: 1.15 $
what has no known bugs.
This Perl implementation of what was written by Ken Schumack firstname.lastname@example.org
This program is copyright by Ken Schumack 1999.
This program is free and open software. You may use, modify, distribute and sell this program (and any modified variants) in any way you wish, provided you do not restrict others from doing the same.