what - extract version information from a file
what [ -s ] filename ...
-s
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...
The command:
prompt%> what test1.pl test2.c a.out
produces:
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 schumacks@att.net
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.
To install PerlPowerTools, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PerlPowerTools
CPAN shell
perl -MCPAN -e shell install PerlPowerTools
For more information on module installation, please visit the detailed CPAN module installation guide.