WHAT(1)
π WHAT(1) β like, the manual page bestie π
okay so real quick β this is WHAT(1), straight out of the User Contributed Perl Documentation collection, and it's genuinely one of those tiny little tools that's lowkey iconic. β¨
πΈ NAME πΈ
what β extract version information from a file. that's it. that's the whole gig. π
π¦ SYNOPSIS π¦
what [ "-s" ] filename ...
β¨ DESCRIPTION β¨
so here's the vibe: what goes through each filename you hand it and hunts for occurrences of the pattern @(#) β the exact same pattern that the SCCS get command drops in when it substitutes for the %Z% ID keyword. π΅οΈββοΈ
then it prints whatever comes after that pattern, up until it hits a ", a >, a NEWLINE, a \, or a null character. that's the stopping point, no cap.
and the slay part? what works on any type of file β NOT just SCCS files. you literally just drop the magic 4-character @(#) pattern into your file and you're set. periodt. π
π₯ OPTIONS π₯
-sβ stop after the very first occurrence of the pattern. like, you found one, you're done, bye. π
π EXIT STATUS π
what exits with status 0 if it found any version information at all, or 1 if it didn't. simple as that fr fr.
π ENVIRONMENT π
the working of what is not influenced by any environment variables. zero. none. it does not care. independently iconic of it honestly. π
π EXAMPLES π
okok so let's say a Perl program test1.pl contains this:
my $REV = '@(# ) $Revision: 1.3 ...
and a C program test2.c contains this:
char rcsid[] = "@(# ) $Revision: 1.15 ....
and then the C program gets compiled into a.out ...
then you run this command:
prompt%> what test1.pl test2.c a.out
and it produces:
test1.pl:
$Revision: 1.3 $';
test2.c:
$Revision: 1.15 $";
a.out;
$Revision: 1.15 $
look at that. three files, three little version receipts. we love a consistent output. π«Ά (and yes bestie, a.out; really does have a semicolon there β that's just how it's printed, don't come for me π)
π BUGS π
what has no known bugs. none. not a single one. she's flawless and she knows it. π
β¨
π AUTHOR π
this Perl implementation of what was written by Ken Schumack β schumacks@att.net. shoutout to the actual legend who made this happen π«‘π
π COPYRIGHT and LICENSE π
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 β the one catch being you do not restrict others from doing the same. share the love, bestie. that's the whole deal. π€π
and that's the page!! π this lil cutie is from perl v5.42.2, dated 2026-02-15 β take her with you, she's yours now. mwah πππ¦
π¦ where this page comes from
- alpine 3.24: perl-power-tools-doc 1.053-r1 Β· GPL-2.0-or-later AND Artistic-1.0-Perl AND Artistic-2.0 AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms