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 the what version 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