WHAT(1P)

πŸ’– what(1P) β€” the POSIX Programmer's Manual one, bestie πŸ’–

okay so before we even start, a lil heads up because this is the POSIX Programmer's Manual version of what, and she comes with a whole situation:

PROLOG β€” This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

like. it might not even exist on your Linux. rude but true. moving on 🫢


✨ NAME ✨

what β€” identify SCCS files (DEVELOPMENT)


🌸 SYNOPSIS 🌸

what [-s] file...

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea, bestie. what goes digging through the files you hand it, searching for all occurrences of the pattern that get (yep, see get) swaps in for the %Z% keyword β€” and that pattern is literally "@(#)". no cap.

Then it writes to standard output whatever follows that pattern, and it keeps going until it hits the first occurrence of one of these lil terminators:

"   >   newline   \   NUL

that's a double quote, a greater-than sign, a newline, a backslash, or a NUL byte. whichever shows up first. periodt. πŸ’…


πŸ‘‘ OPTIONS πŸ‘‘

The what utility shall conform to the Base Definitions volume of POSIX.1‐2017, Section 12.2, Utility Syntax Guidelines. (yes bestie, there are rules. we follow them.)

The following option shall be supported:

  • -s β€” Quit after finding the first occurrence of the pattern in each file. like, she found one, she's done, she's leaving the group chat. bye πŸ’…

πŸŽ€ OPERANDS πŸŽ€

The following operands shall be supported:

  • file β€” A pathname of a file to search. that's it. that's the whole vibe.

🌈 STDIN 🌈

Not used. she's not reading your keyboard input, bestie. not today.


πŸ“ INPUT FILES πŸ“

The input files shall be of any file type. any. she does not discriminate. icon behavior honestly.


πŸ’œ ENVIRONMENT VARIABLES πŸ’œ

The following environment variables shall affect the execution of what:

  • LANG β€” Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1‐2017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) yes that's a mouthful, i know, i'm just the messenger 🫠
  • LC_ALL β€” If set to a non-empty string value, override the values of all the other internationalization variables. she's the main character, she overrides everyone.
  • LC_CTYPE β€” Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files).
  • LC_MESSAGES β€” Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.
  • NLSPATH β€” Determine the location of message catalogs for the processing of LC_MESSAGES.

🧚 ASYNCHRONOUS EVENTS 🧚

Default. nothing special, no drama, just vibes. ✨


⭐ STDOUT ⭐

The standard output shall consist of the following for each file operand:

"%s:\n\t%s\n", <pathname>, <identification string>

like. pathname, then a newline, then a tab, then the identification string, then a newline. that's the whole shape of it. slay.


πŸ”₯ STDERR πŸ”₯

The standard error shall be used only for diagnostic messages. she's not gonna spam it, she's got manners.


πŸ’– OUTPUT FILES πŸ’–

None. she writes to stdout and she's done. no files created, no mess, no crumbs. πŸŽ€


🌸 EXTENDED DESCRIPTION 🌸

None. genuinely. that's the whole section. nothing here. moving on bestie πŸ¦‹


πŸ‘‘ EXIT STATUS πŸ‘‘

The following exit values shall be returned:

  • 0 β€” Any matches were found. yay! we ate!
  • 1 β€” Otherwise. 😭

🌈 CONSEQUENCES OF ERRORS 🌈

Default.

The following sections are informative.


πŸ’… APPLICATION USAGE πŸ’…

The what utility is intended to be used in conjunction with the SCCS command get, which automatically inserts identifying information, but it can also be used where the information is inserted by any other means. so like, she doesn't need get, she's flexible, she's adaptable, she's everything.

When the string "@(#)" is included in a library routine in a shared library, it might not be found in an a.out file using that library routine. so don't come for her when that happens, that's just how it is. πŸ™ˆ


πŸ“ EXAMPLES πŸ“

okay so imagine the C-language program in file f.c contains:

char ident[] = "@(#)identification information";

and f.c is compiled to yield f.o and a.out, then the command:

what f.c f.o a.out

writes:

f.c:
    identification information
    ...
f.o:
    identification information
    ...
a.out:
    identification information
    ...

look at her go. three files, three identifications, zero problems. iconic. ⭐


🧚 RATIONALE 🧚

None. bestie said no thoughts, head empty. πŸ’œ


⭐ FUTURE DIRECTIONS ⭐

None. she's staying exactly how she is. queen behavior.


πŸŽ€ SEE ALSO πŸŽ€

  • get

The Base Definitions volume of POSIX.1‐2017, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines


Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


and that's the whole page, bestie 🫢 shoutout to IEEE/The Open Group, 2017 for bringing us WHAT(1P) β€” we love her, we respect her, we read the manual. periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from