what(1)
π what(1) β bestie's guide to digging SCCS version tea out of files β¨
okay so first things first, the page you're reading is what(1) from the User Commands corner of the manual, and it's genuinely one of the most satisfying little utilities ever. like, it's not doing a lot, but what it does it does flawlessly. π«Ά
πΈ NAME πΈ
what β pull SCCS version info out of a file, no cap
π SYNOPSIS π
what [-s] filename...
that's it. that's the whole vibe. β¨
π DESCRIPTION π
so the what utility goes snooping through each filename you give it, looking for occurrences of the pattern @(#) β which is the thing the SCCS get command (peep sccs-get(1)) swaps in for the %Z% ID keyword. and then it prints everything that comes after that pattern, all the way up until it hits a ", a >, a NEWLINE, a \, or a NULL character. π
so yeah, it's basically a little treasure hunter for identification strings. iconic behaviour, honestly.
β¨ OPTIONS β¨
here's the option that's supported:
-sβ stops after the first occurrence of the pattern. one and done, bestie. π―
and then there's this trio, all doing the same thing:
-V-version--versionβ prints thewhatversion number string and exits.
heads up babes: this option is a SCHILY extension, which means it does not exist in historic sccs implementations. so don't go expecting it on your grandma's SCCS, ok? π
π¦ EXAMPLES π¦
Example 1 β Extracting SCCS version information
say a C program in the file program.c contains this:
char sccsid[] = "@(#)identification information";
and program.c gets compiled to yield program.o and a.out. then this command:
example% what program.c program.o a.out
produces:
program.c: identification information
program.o: identification information
a.out: identification information
look at that. all three files, all matching, all slaying. π₯
π ENVIRONMENT VARIABLES π
peep environ(7) for the descriptions of these environment variables that affect how what runs: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH. β
π EXIT STATUS π
here's what you get back:
0β any matches were found. yay! π1β no matches found. π (it happens to the best of us)
π ATTRIBUTES π
peep attributes(7) for descriptions of these attributes:
- Attribute Type:
Availabilityβ Attribute Value:SUNWsprot - Attribute Type:
Interface Stabilityβ Attribute Value:Standard
π§ SEE ALSO π§
what rolls with a whole squad, ok. it's giving extended family reunion:
sccs(1), sccs-add(1), sccs-admin(1), sccs-branch(1), sccs-cdc(1), sccs-check(1), sccs-clean(1), sccs-comb(1), sccs-commit(1), sccs-create(1), sccs-cvt(1), sccs-deledit(1), sccs-delget(1), sccs-delta(1), sccs-diffs(1), sccs-edit(1), sccs-editor(1), sccs-enter(1), sccs-fix(1), sccs-get(1), sccs-help(1), sccs-histfile(1), sccs-info(1), sccs-init(1), sccs-istext(1), sccs-ldiffs(1), sccs-log(1), sccs-print(1), sccs-prs(1), sccs-prt(1), sccs-rcs2sccs(1), sccs-remove(1), sccs-rename(1), sccs-rmdel(1), sccs-root(1), sccs-sact(1), sccs-sccsdiff(1), sccs-status(1), sccs-tell(1), sccs-unedit(1), sccs-unget(1), sccs-val(1), sccschangeset(5), sccsfile(5), attributes(7), environ(7), standards(7).
periodt. π
π DIAGNOSTICS π
use the SCCS help command for explanations (see sccs-help(1)). it's the friend who actually knows what's going on.
π BUGS π
ok so there's a remote possibility β remote, like, don't panic β that a spurious occurrence of the @(#) pattern could be found by what. so like... it might match something that isn't actually an SCCS ID. fraudulence potential, ngl. π©
got bugs or suggestions? mail them to schilytools@mlists.in-berlin.de or open a ticket at https://codeberg.org/schilytools/schilytools/issues. π«Ά
the mailing list archive may be found at:
https://mlists.in-berlin.de/mailman/listinfo/schilytools-mlists.in-berlin.de
πΈ AUTHORS πΈ
ok history lesson time, because this is genuinely kinda iconic:
the SCCS suite was originally written by Marc J. Rochkind at Bell Labs in 1972. Release 4.0 of SCCS β which introduced new versions of the programs admin(1), get(1), prt(1), and delta(1) β was published on February 18, 1977, and it introduced the new text based SCCS v4 history file format (previous SCCS releases used a binary history file format, wild right?). π
the SCCS suite was later maintained by various people at AT&T and Sun Microsystems. and since 2006, the SCCS suite has been maintained by Joerg Schilling and the schilytools project authors. main character energy fr fr. π
π SOURCE DOWNLOAD π
the source code for sccs is included in the schilytools project and may be retrieved from the schilytools project at Codeberg at:
https://codeberg.org/schilytools/schilytools
the download directory is:
https://codeberg.org/schilytools/schilytools/releases
go get it bestie, it's free β¨
and that's the whole page! this little cutie is from SunOS 5.11, dated 2022/10/06 β what(1), out. πππ¦
π¦ where this page comes from
- opensuse-leap 16.0: sccs 2022.10.16-160000.2.2 Β· CDDL-1.0
- opensuse-leap 16.0: sccs 2022.10.16-160000.2.2 Β· CDDL-1.0
- opensuse-leap 16.0: sccs 2022.10.16-160000.2.2 Β· CDDL-1.0
- opensuse-leap 16.0: sccs 2022.10.16-160000.2.2 Β· CDDL-1.0
- Copyright 2007-2020 J. Schilling
- Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved
- Copyright 1989 AT&T
- Copyright 2007-2016 J. Schilling
- Copyright 2022 the schilytools team
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms