WHAT(1)

πŸ“¦ version 1.053, in alpine 3.24

πŸ’… 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 πŸ«‘πŸ’œ


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