Creates a specified version of a SCCS file.
get [ -g ] [ -m ] [ -n ] [ -p ] [ -s ] [ -c Cutoff ] [ -i List ] [ -r SID ] [ -t ] [ -x List ] [ -w String ] [ -l [ p ] ] [ -L ] File ...
get [ -e ] [ -k ] [ -b ] [ -s ] [ -c Cutoff ] [ -i List ] [ -r SID ] [ -t ] [ -x List ] [ -l [ p ] ] [ -L ] File ...
The get command reads a specified version of the Source Code Control System (SCCS) file and creates an ASCII text file according to the specified flags. The get command then writes each text file to a file having the same name as the original SCCS file but without the s. prefix (the g-file).
Flags and files can be specified in any order, and all flags apply to all named files. If you specify a directory for the File parameter, the get command performs the requested actions on all files in the directory that begin with the s. prefix. If you specify a - (minus sign) for the File parameter, the get command reads standard input and interprets each line as the name of an SCCS file. The get command continues to read input until it reads an end-of-file character.
If the effective user has write permission in the directory containing the SCCS files but the real user does not, then only one file can be named when the -e flag is used.
The get command creates both read-only versions and editable versions of a file. Read-only versions of files should be used if the application does not require changes to the file contents. Read-only versions of source code files can be compiled. Text files can be displayed or printed from read-only versions.
The difference between an editable and a read-only version is important when using identification keywords. Identification keywords are symbols expanded to some text value when the get command retrieves the file as read-only. In editable versions, keywords are not expanded. Identification keywords can appear anywhere in an SCCS file. See the prs command for further information on identification keywords.
In addition to the file with the s. prefix (the s-file), the get command creates several auxiliary files: the g-file, l-file, p-file, and z-file. These files are identified by their tag, which is the letter before the hyphen. The get program names auxiliary files by replacing the leading s. in the SCCS file name with the appropriate tag, except for the g-file, which is named by removing the s. prefix. So, for a file named s.sample, the auxiliary file names would be sample, l.sample, p.sample, and z.sample.
These files serve the following purposes:
When you use the get command, it displays the SID being accessed and the number of lines created from the SCCS file. If you specify the -e flag, the SID of the delta to be made appears after the SID is accessed and before the number of lines created. If you specify more than one file, a directory, or standard input, the get command displays the file name before each file is processed. If you specify the -i flag, the get command lists included deltas below the word Included. If you specify the -x flag, the get command lists excluded deltas below the word Excluded.
The following table illustrates how the get command determines both the SID of the file it retrieves and the pending SID. The SID Specified column shows various ways the SID can be specified with the -r flag. The next two columns illustrate various conditions that can exist, including whether or not the -b flag is used with the get -e command. The SID Retrieved column indicates the SID of the file that makes up the g-file. The SID of Delta to Be Created column indicates the SID of the version that will be created when the delta command is applied.
1 Applies only if the -d (default SID) flag is not present in the file (see the admin command).
2 The mR indicates the maximum existing release.
3 Forces creation of the first delta in a new release.
4 The hR is the highest existing release lower than the specified, nonexistent release R.
Identification Keywords
Identifying information is inserted into the text retrieved from the SCCS file by replacing identification keywords with their value wherever they occur. The following keywords may be used in the text stored in an SCCS file:
-b | Specifies that the delta to be created should have an SID in a new branch. The new SID is numbered according to the rules given in the SID determination table. You can use the -b flag only with the -e flag. It is only necessary when you want to branch from a leaf delta (a delta without a successor). Attempting to create a delta at a nonleaf delta automatically results in a branch, even if the b header flag is not set. If you do not specify the b header flag in the SCCS file, the get command ignores the -b flag because the file does not allow branching. |
-c Cutoff | Specifies a cutoff date and time, in the form YY[MM[DD[HH[MM[SS]]]]]. The get command includes
no deltas to the SCCS file created after the specified cutoff in the g-file.
The values of any unspecified items in the Cutoff
variable default to their maximum allowable values. Thus, a cutoff date and
time specified with only the year (YY) would specify the last month, day,
hour, minute, and second of that year. Any number of nonnumeric characters
can separate the two-digit items of the Cutoff variable
date and time. This allows you to specify a date and time in a number of ways,
as follows:
-c85/9/2,9:00:00 -c"85/9/2 9:00:00" "-c85/9/2 9:00:00" |
-e | Indicates that the g-file being created is to be edited by the user
applying the get command. The changes are recorded later
with the delta command. The get -e command creates a p-file that prevents other users from issuing another get -e command and editing a second g-file on the same SID
before the delta command is run. The owner of the file
can override this restriction by allowing joint editing on the same SID through
the use of the admin command
with the -fj flag. Other users, with permission, can
obtain read-only copies by using the get command without
the -e flag. The get -e command enforces SCCS file protection specified with the ceiling,
floor, and authorized user list in the SCCS file. See the admin command.
Note
If you accidentally ruin
the g-file created using the get -e command, you can recreate the file with the get -k command. |
-g | Suppresses the actual creation of the g-file. Use the -g flag primarily to create an l-file or to verify the existence of a particular SID. Do not use it with the -e flag. |
-i List | Specifies a list of deltas to be included in the creation of a g-file.
The SID list format consists of a combination of individual SIDs separated
by commas and SID ranges indicated by two SIDs separated by a hyphen. You
can specify the same SIDs with either of the following command lines:
get -e -i1.4,1.5,1.6 s.file get -e -i1.4-1.6 s.file You can specify the SCCS identification of a delta in any form shown in the SID Specified column of the previous table. The get command interprets partial SIDs as shown in the SID Retrieved column. |
-k | Suppresses replacement of identification keywords in the g-file by their value. The -k flag is implied by the -e flag. If you accidentally ruin the g-file created using the get -e command, you can recreate the file by reissuing the get command with the -k flag instead of the -e flag. |
-l[ p ] | Writes a delta summary to an l-file. If you specify -lp, the delta summary is written to standard output, and the get command does not create the l-file. Use this flag to determine which deltas were used to create the g-file currently in use. See the sccsfile file for the format of the l-file. See also the -L flag. |
-L | Writes a delta summary to standard output. Specifying the -L flag is the same as using the -lp flag. |
-m | Writes before each line of text in the g-file the SID of the delta
that inserted the line into the SCCS file. The format is:
SID tab line of text |
-n | Writes the value of the 68 keyword before
each line of text in the g-file. The format is the value of 68, followed by a horizontal tab, followed by the text line. When both
the -m and -n flags are used,
the format is:
68 value tab SID tab line of text |
-p | Writes the text created from the SCCS file to standard output and does not create a g-file. All informative output usually sent to standard output is sent to standard error, unless you specify the -s flag with the -p flag. In this case, output usually sent to standard output does not appear anywhere. |
-r SID | Specifies the SCCS identification string (SID) of the SCCS file version to be created. The SID determination table shows the version of the created file and the SID of the pending delta as functions of the specified SID. |
-s | Suppresses all output usually written to standard output. Error messages (written to standard error output), remain unaffected. |
-t | Accesses the most recently created delta in a given release or for a given release and level. |
-w String | Substitutes the String value for the src/idd/en_US/cmds/aixcmds2/get.ide, idaixcmds2, idd520, 0132A_idd520 keyword in g-files not intended for editing. |
-x List | Excludes the specified list of deltas in the creation of the g-file. See the -i flag for the SID list format. |
This command returns the following exit values:
0 | Successful completion. |
>0 | An error occurred. |
The following descriptions and examples illustrate the differences between read-only and editable versions of files.
8/8/01 1.5
8/8/01 is the symbol for the current date and 1.5 is the symbol for the SID. When the get command retrieves a file as editable, it leaves the symbols in the file and does not perform text value substitution.
$ ls s.test.c $ get s.test.c 3.5 59 lines $ ls s.test.c test.c
$ get -r1.3 s.test.c 1.3 67 lines $ get -r1.3.1.4 s.test.c 1.3.1.4 50 lines
$ get -r2 s.test.c 2.7 21 lines
$ get -r9 s.test.c 7.6 400 lines
$ get -t -r3 s.test.c 3.2.1.5 46 lines
$ ls s.test.c $ get -e s.test.c 1.3 new delta 1.4 67 lines $ ls p.test.c s.test.c test.c
The working file is test.c. If you edit this file and save the changes with the delta command, SCCS creates a new delta with an SID of 1.4. The file p.test.c is a temporary file used by SCCS to keep track of file versions.
In the previous example, you could have used the -r flag to get a specific version. Assuming release 1 is the highest existing release and that delta 1.3 already exists and is the highest delta in release, the following three uses of the get command are equivalent:
$ get -e s.test.c $ get -e -r1 s.test.c $ get -e -r1.3 s.test.c
$ get -e -r2 s.test.c 1.3 new delta 2.1 67 lines
Notice that the get command indicates the version of the new delta that will be created if the delta command stores changes to the SCCS file.
$ get -e -r1.3 s.test.c 1.3 new delta 1.3.1.1 67 lines
Creates deltas on branches using the same methods.
To edit a file, get the file version using the get -e command and save the changes with the delta command. Several different editable versions of an SCCS file can exist as long as each one is in a different directory. If you try to put duplicates of an editable file version into a directory (using the get command) without using the delta command, SCCS writes an error message.
To get the same editable file version more than once, set the j header flag in the SCCS file with the admin command. Set the j option by using the -f flag. You can then get the same SID several times from different directories, creating a separate file for each get command. Although the files originate from a single SID, SCCS gives each of them a unique new SID.
$ pwd /home/marty/sccs $ admin -fj s.test.c
$ get -e s.test.c 1.1 new delta 1.2 5 lines
$ cd /home/new $ get -e /home/marty/sccs/s.test.c 1.2 new delta 1.1.1.1 5 lines
Notice that SCCS creates two deltas, 1.2 and 1.1.1.1, from the single original file version of 1.1. Look at the p.test.c file. It shows a separate entry for each version currently in use. The p.test.c file remains in the directory until you take care of both file versions with either the delta command or the unget command.
/usr/bin/get | Contains the get command. |
The admin command, delta command, prs command, and sact command, sccshelp command, unget command, what command.
The sccsfile file format in AIX 5L Version 5.2 Files Reference.
List of SCCS Commands in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
Source Code Control System (SCCS) Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.