GET(1POSIX)

GET(1POSIX) πŸ’–

okay bestie, welcome to the POSIX Programmer's Manual ✨ this is the get page, and she's a whole icon.


PROLOG πŸŽ€

okay so first things first, this manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β€” so if you're on Linux, go consult the corresponding Linux manual page for the deets on Linux behavior. OR the interface might not even be implemented on Linux at all. πŸ’€ just so you know.


NAME 🌸

get β€” get a version of an SCCS file (DEVELOPMENT)


SYNOPSIS ✨

get [-begkmnlLpst] [-c cutoff] [-i list] [-r SID] [-x list] file...

DESCRIPTION πŸ’…

The get utility shall generate a text file from each named SCCS file, according to the specifications given by its options. periodt.

The generated text shall normally be written into a file called the g-file, whose name is derived from the SCCS filename by simply removing the leading "s.". (yes bestie, literally just chop that s. off, that's the whole vibe πŸ¦‹)


OPTIONS πŸ‘‘

The get utility shall conform to the Base Definitions volume of POSIX.1‐2017, Section 12.2, Utility Syntax Guidelines.

The following options shall be supported:

  • -r SID β€” Indicate the SCCS Identification String (SID) of the version (delta) of an SCCS file to be retrieved. The table shows, for the most useful cases, what version of an SCCS file is retrieved (as well as the SID of the version to be eventually created by delta if the -e option is also used), as a function of the SID specified. 🎯
  • -c cutoff β€” Indicate the cutoff date-time, in the form:
YY[MM[DD[HH[MM[SS]]]]]

For the YY component, values in the range [69,99] shall refer to years 1969 to 1999 inclusive, and values in the range [00,68] shall refer to years 2000 to 2068 inclusive.

Note: It is expected that in a future version of this standard the default century inferred from a 2-digit year will change. (This would apply to all commands accepting a 2-digit year as input.)

No changes (deltas) to the SCCS file that were created after the specified cutoff date-time shall be included in the generated text file. Units omitted from the date-time default to their maximum possible values; for example, -c 7502 is equivalent to -c 750228235959. 🀯

Any number of non-numeric characters may separate the various 2-digit pieces of the cutoff date-time. This feature allows the user to specify a cutoff date in the form: -c "77/2/2 9:22:25".

  • -e β€” Indicate that the get is for the purpose of editing or making a change (delta) to the SCCS file via a subsequent use of delta. The -e option used in a get for a particular version (SID) of the SCCS file shall prevent further get commands from editing on the same SID until delta is executed or the j (joint edit) flag is set in the SCCS file. Concurrent use of get -e for different SIDs is always allowed. πŸ”₯

If the g-file generated by get with a -e option is accidentally ruined in the process of editing, it may be regenerated by re-executing the get command with the -k option in place of the -e option. (been there bestie 😭)

SCCS file protection specified via the ceiling, floor, and authorized user list stored in the SCCS file shall be enforced when the -e option is used.

  • -b β€” Use with the -e option to indicate that the new delta should have an SID in a new branch as shown in the table below. This option shall be ignored if the b flag is not present in the file or if the retrieved delta is not a leaf delta. (A leaf delta is one that has no successors on the SCCS file tree. πŸƒ)
Note: A branch delta may always be created from a non-leaf delta.
  • -i list β€” Indicate a list of deltas to be included (forced to be applied) in the creation of the generated file. The list has the following syntax:
<list> ::= <range> | <list> , <range>
<range> ::= SID | SID - SID

SID, the SCCS Identification of a delta, may be in any form shown in the ``SID Specified'' column of the table in the EXTENDED DESCRIPTION section, except that the result of supplying a partial SID is unspecified. A diagnostic message shall be written if the first SID in the range is not an ancestor of the second SID in the range. πŸ’€

  • -x list β€” Indicate a list of deltas to be excluded (forced not to be applied) in the creation of the generated file. See the -i option for the list format.
  • -k β€” Suppress replacement of identification keywords (see below) in the retrieved text by their value. The -k option shall be implied by the -e option.
  • -l β€” Write a delta summary into an l-file. πŸŽ€
  • -L β€” Write a delta summary to standard output. All informative output that normally is written to standard output shall be written to standard error instead, unless the -s option is used, in which case it shall be suppressed.
  • -p β€” Write the text retrieved from the SCCS file to the standard output. No g-file shall be created. All informative output that normally goes to the standard output shall go to standard error instead, unless the -s option is used, in which case it shall disappear. ✨
  • -s β€” Suppress all informative output normally written to standard output. However, fatal error messages (which shall always be written to the standard error) shall remain unaffected. πŸ’…
  • -m β€” Precede each text line retrieved from the SCCS file by the SID of the delta that inserted the text line in the SCCS file. The format shall be:
"%s\t%s", <SID>, <text line>
  • -n β€” Precede each generated text line with the %M% identification keyword value (see below). The format shall be:
"%s\t%s", <%M% value>, <text line>

When both the -m and -n options are used, the <text line> shall be replaced by the -m option-generated format. πŸ¦‹

  • -g β€” Suppress the actual retrieval of text from the SCCS file. It is primarily used to generate an l-file, or to verify the existence of a particular SID. πŸ‘€
  • -t β€” Use to access the most recently created (top) delta in a given release (for example, -r 1), or release and level (for example, -r 1.2).

OPERANDS 🌸

The following operands shall be supported:

  • file β€” A pathname of an existing SCCS file or a directory. If file is a directory, the get utility shall behave as though each file in the directory were specified as a named file, except that non-SCCS files (last component of the pathname does not begin with s.) and unreadable files shall be silently ignored. πŸ™ˆ

If exactly one file operand appears, and it is '-', the standard input shall be read; each line of the standard input is taken to be the name of an SCCS file to be processed. Non-SCCS files and unreadable files shall be silently ignored.


STDIN πŸ’œ

The standard input shall be a text file used only if the file operand is specified as '-'. Each line of the text file shall be interpreted as an SCCS pathname.


INPUT FILES 🧚

The SCCS files shall be files of an unspecified format. (mysterious. iconic. we don't ask questions πŸ’…)


ENVIRONMENT VARIABLES 🌈

The following environment variables shall affect the execution of get:

  • 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.)
  • LC_ALL β€” If set to a non-empty string value, override the values of all the other internationalization variables.
  • 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, and informative messages written to standard output (or standard error, if the -p option is used).
  • NLSPATH β€” Determine the location of message catalogs for the processing of LC_MESSAGES.
  • TZ β€” Determine the timezone in which the times and dates written in the SCCS file are evaluated. If the TZ variable is unset or NULL, an unspecified system default timezone is used. ⏰

ASYNCHRONOUS EVENTS ⭐

Default. (no drama here bestie, it's giving chill 🫢)


STDOUT πŸ“

For each file processed, get shall write to standard output the SID being accessed and the number of lines retrieved from the SCCS file, in the following format:

"%s\n%d lines\n", <SID>, <number of lines>

If the -e option is used, the SID of the delta to be made shall appear after the SID accessed and before the number of lines generated, in the POSIX locale:

"%s\nnew delta %s\n%d lines\n", <SID accessed>,
    <SID to be made>, <number of lines>

If there is more than one named file or if a directory or standard input is named, each pathname shall be written before each of the lines shown in one of the preceding formats:

"\n%s:\n", <pathname>

If the -L option is used, a delta summary shall be written following the format specified below for l-files.

If the -i option is used, included deltas shall be listed following the notation, in the POSIX locale:

"Included:\n"

If the -x option is used, excluded deltas shall be listed following the notation, in the POSIX locale:

"Excluded:\n"

If the -p or -L options are specified, the standard output shall consist of the text retrieved from the SCCS file. πŸ”₯


STDERR 😭

The standard error shall be used only for diagnostic messages, except if the -p or -L options are specified, it shall include all informative messages normally sent to standard output.


...to be continued bestie, don't go anywhere πŸŽ€βœ¨

πŸ’Ύ OUTPUT FILES πŸ’Ύ

okay so this is the part where get starts making stuff, and bestie, it makes a LOT of stuff. Several auxiliary files may be created by get. They've got a whole lil friend group and collectively they're known as the g-file, the l-file, the p-file, and the z-file. 🫢

The letter sitting before the <hyphen-minus> is called the tag. Cute, right?

Here's the naming tea β˜•: an auxiliary filename gets formed from the SCCS filename. The application shall ensure that the last component of all SCCS filenames is of the form s.modulename β€” and then the auxiliary files get named by swapping that leading s for the tag. ✨

The g-file is the one rebel of the group: the g-file is named by removing the s. prefix. No tag, no nothing, it's just out here living free.

So for s.xyz.c, the auxiliary filenames would be:

xyz.c
l.xyz.c
p.xyz.c
z.xyz.c

respectively. πŸŽ€ (That's g-file, l-file, p-file, z-file β€” in order, iykyk.)


🌸 the g-file 🌸

The g-file contains the generated text, and it shall be created in the current directory β€” unless the -p option is used. πŸ‘€

A g-file shall be created in all cases, whether or not any lines of text were generated by the get. Like, even if it's giving nothing, it still shows up. It shall be owned by the real user.

Now, permissions drama:

  • If the -k option is used or implied β†’ the g-file shall be writable by the owner only (so, read-only for everyone else).
  • Otherwise β†’ it shall be read-only. periodt.

And only the real user need have write permission in the current directory. πŸ’…


πŸ“ the l-file πŸ“

The l-file holds a table showing which deltas were applied in generating the retrieved text. Slay, receipts! 🧾

It shall be created in the current directory if the -l option is used; it shall be read-only and it is owned by the real user. And again β€” only the real user need have write permission in the current directory.

Lines in the l-file shall have this format, exactly:

"%c%c%c %s\t%s %s\n", <code1>, <code2>, <code3>,
    <SID>, <date-time>, <login>

where the entries are:

  • <code1> β€” a <space> if the delta was applied; '*' otherwise. ⭐
  • <code2> β€” a <space> if the delta was applied or was not applied and ignored; '*' if the delta was not applied and was not ignored. πŸ’€
  • <code3> β€” a character indicating a special reason why the delta was or was not applied:
    • I β€” Included.
    • X β€” Excluded.
    • C β€” Cut off (by a -c option).
  • <date-time> β€” date and time (using the format of the date utility's %y/%m/%d %T conversion specification format) of creation. ⏰
  • <login> β€” login name of person who created delta.

The comments and MR data shall follow on subsequent lines, indented one <tab>. A blank line shall terminate each entry. 🌈


πŸ”’ the p-file πŸ”’

The p-file is the lil messenger πŸ•ŠοΈ β€” it's used to pass information resulting from a get with a -e option along to delta.

Its contents shall also be used to prevent a subsequent execution of get with a -e option for the same SID until delta is executed or the joint edit flag, j, is set in the SCCS file. (So like, no sneaking in twice, bestie. 🚫)

The p-file shall be created in the directory containing the SCCS file, and the application shall ensure that the effective user has write permission in that directory. It shall be writable by owner only, and owned by the effective user.

Each line in the p-file shall have the following format:

"%s %s %s %s%s%s\n", <g-file SID>,
    <SID of new delta>, <login-name of real user>,
    <date-time>, <i-value>, <x-value>

where:

  • <i-value> uses the format "" if no -i option was specified, and shall use the format:
" -i%s", <-i option option-argument>

if a -i option was specified.

  • <x-value> uses the format "" if no -x option was specified, and shall use the format:
" -x%s", <-x option option-argument>

if a -x option was specified.

There can be an arbitrary number of lines in the p-file at any time; no two lines shall have the same new delta SID. πŸ“Œ


πŸ” the z-file πŸ”

The z-file is the bouncer at the club πŸšͺ β€” it shall serve as a lock-out mechanism against simultaneous updates.

Its contents shall be the binary process ID of the command (that is, get) that created it. πŸ†”

The z-file shall be created in the directory containing the SCCS file, for the duration of get. And the same protection restrictions as those for the p-file shall apply for the z-file. The z-file shall be created read-only.

bestie the z-file is literally the "occupied" sign on the bathroom door. do NOT try to barge in. πŸ™ˆ

✨ EXTENDED DESCRIPTION ✨

πŸŽ€ Determination of SCCS Identification String πŸŽ€

ok so this is the big one, bestie β€” the ✨chart✨ that decides which SID you get back and which new delta is gonna be born. Every row is: the SID you specified, whether -b is doing anything, what else is true, the SID it retrieves, and the SID of the delta it creates. Here we go πŸ’…

  • SID specified: none‑ Β· -b keyletter used: no Β· other conditions: R defaults to mR Β· SID retrieved: mR.mL Β· SID of delta to be created: mR.(mL+1)
  • SID specified: none‑ Β· -b keyletter used: yes Β· other conditions: R defaults to mR Β· SID retrieved: mR.mL Β· SID of delta to be created: mR.mL.(mB+1).1
  • SID specified: R Β· -b keyletter used: no Β· other conditions: R > mR Β· SID retrieved: mR.mL Β· SID of delta to be created: R.1***
  • SID specified: R Β· -b keyletter used: no Β· other conditions: R = mR Β· SID retrieved: mR.mL Β· SID of delta to be created: mR.(mL+1)
  • SID specified: R Β· -b keyletter used: yes Β· other conditions: R > mR Β· SID retrieved: mR.mL Β· SID of delta to be created: mR.mL.(mB+1).1
  • SID specified: R Β· -b keyletter used: yes Β· other conditions: R = mR Β· SID retrieved: mR.mL Β· SID of delta to be created: mR.mL.(mB+1).1
  • SID specified: R Β· -b keyletter used: - Β· other conditions: R < mR and R does not exist Β· SID retrieved: hR.mL** Β· SID of delta to be created: hR.mL.(mB+1).1
  • SID specified: R Β· -b keyletter used: - Β· other conditions: Trunk successor in release > R and R exists Β· SID retrieved: R.mL Β· SID of delta to be created: R.mL.(mB+1).1
  • SID specified: R.L Β· -b keyletter used: no Β· other conditions: No trunk successor Β· SID retrieved: R.L Β· SID of delta to be created: R.(L+1)
  • SID specified: R.L Β· -b keyletter used: yes Β· other conditions: No trunk successor Β· SID retrieved: R.L Β· SID of delta to be created: R.L.(mB+1).1
  • SID specified: R.L Β· -b keyletter used: - Β· other conditions: Trunk successor in release β‰₯ R Β· SID retrieved: R.L Β· SID of delta to be created: R.L.(mB+1).1
  • SID specified: R.L.B Β· -b keyletter used: no Β· other conditions: No branch successor Β· SID retrieved: R.L.B.mS Β· SID of delta to be created: R.L.B.(mS+1)
  • SID specified: R.L.B Β· -b keyletter used: yes Β· other conditions: No branch successor Β· SID retrieved: R.L.B.mS Β· SID of delta to be created: R.L.(mB+1).1
  • SID specified: R.L.B.S Β· -b keyletter used: no Β· other conditions: No branch successor Β· SID retrieved: R.L.B.S Β· SID of delta to be created: R.L.B.(S+1)
  • SID specified: R.L.B.S Β· -b keyletter used: yes Β· other conditions: No branch successor Β· SID retrieved: R.L.B.S Β· SID of delta to be created: R.L.(mB+1).1
  • SID specified: R.L.B.S Β· -b keyletter used: - Β· other conditions: Branch successor Β· SID retrieved: R.L.B.S Β· SID of delta to be created: R.L.(mB+1).1

ok now the footnotes, because the asterisks are doing a LOT of heavy lifting here 🫢

  • * β€” R, L, B, and S are the release, level, branch, and sequence components of the SID, respectively; m means maximum. So for example, R.mL means "the maximum level number within release R"; R.L.(mB+1).1 means "the first sequence number on the new branch (that is, maximum branch number plus one) of level L within release R". Note that if the SID specified is of the form R.L, R.L.B, or R.L.B.S, each of the specified components shall exist.
  • ** β€” hR is the highest existing release that is lower than the specified, nonexistent, release R.
  • *** β€” This is used to force creation of the first delta in a new release.
  • † β€” The -b option is effective only if the b flag is present in the file. An entry of - means "irrelevant".
  • ‑ β€” This case applies if the d (default SID) flag is not present in the file. If the d flag is present in the file, then the SID obtained from the d flag is interpreted as if it had been specified on the command line. Thus, one of the other cases in this table applies.

πŸ•°οΈ System Date and Time πŸ•°οΈ

When a g-file gets generated, the creation time of deltas in the SCCS file may be taken into account. And listen β€” if any of these times are apparently in the future, the behavior is unspecified. Not "weird", not "undefined-ish", literally unspecified. Respect the timeline bestie ⏳✨


πŸ”‘ Identification Keywords πŸ”‘

Identifying info gets inserted into the text retrieved from the SCCS file by replacing identification keywords with their value wherever they occur. Here are all the keywords you can use in the text stored in an SCCS file:

  • %M% β€” Module name: either the value of the m flag in the file, or if absent, the name of the SCCS file with the leading s. removed.
  • %I% β€” SCCS identification (SID) (%R%.%L% or %R%.%L%.%B%.%S%) of the retrieved text.
  • %R% β€” Release.
  • %L% β€” Level.
  • %B% β€” Branch.
  • %S% β€” Sequence.
  • %D% β€” Current date (YY/MM/DD).
  • %H% β€” Current date (MM/DD/YY).
  • %T% β€” Current time (HH:MM:SS).
  • %E% β€” Date newest applied delta was created (YY/MM/DD).
  • %G% β€” Date newest applied delta was created (MM/DD/YY).
  • %U% β€” Time newest applied delta was created (HH:MM:SS).
  • %Y% β€” Module type: value of the t flag in the SCCS file.
  • %F% β€” SCCS filename.
  • %P% β€” SCCS absolute pathname.
  • %Q% β€” The value of the q flag in the file.
  • %C% β€” Current line number. This keyword is intended for identifying messages output by the program, such as "this should not have happened" type errors. It is not intended to be used on every line to provide sequence numbers.
  • %Z% β€” The four-character string "@(#)" recognizable by what.
  • %W% β€” A shorthand notation for constructing what strings:
%W%=%Z%%M%<tab>%I%
  • %A% β€” Another shorthand notation for constructing what strings:
%A%=%Z%%Y%%M%%I%%Z%

🌈 EXIT STATUS 🌈

These are the exit values that shall be returned, and yes there are only two, it's giving minimalism:

  • 0 β€” Successful completion. πŸŽ‰
  • >0 β€” An error occurred. πŸ’€

πŸ’… CONSEQUENCES OF ERRORS πŸ’…

Default.

The following sections are informative.


🫢 APPLICATION USAGE 🫢

Problems can arise if the system date and time have been modified (for example, put forward and then back again, or unsynchronized clocks across a network) and can also arise when different values of the TZ environment variable are used.

Problems of a similar nature can also arise for the operation of the delta utility, which compares the previous file body against the working file as part of its normal operation.

ngl the clock is NOT your friend here. time zones and time travel will both absolutely jump you πŸ™ˆ

πŸ“ EXAMPLES πŸ“

None.


🧚 RATIONALE 🧚

None.


⭐ FUTURE DIRECTIONS ⭐

None.


πŸ‘‘ SEE ALSO πŸ‘‘

  • admin, delta, prs, what
  • 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 a wrap bestie!! this whole thing came from IEEE/The Open Group, 2017, GET(1POSIX) β€” go forth and retrieve some versions, you absolute icon πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from