[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs

Creating, Editing, and Updating an SCCS File

You can create, edit, and update an SCCS file using the admin, get, and delta commands.

Creating an SCCS File

admin Creates an SCCS file or changes an existing SCCS file.

Editing an SCCS file

Attention: Do not edit SCCS files directly with non-SCCS commands, or you can damage the SCCS files.
get Gets a specified version of an SCCS file for editing or compiling.
  1. To edit an SCCS file, enter the get command with the -e flag to produce an editable version of the file:
    get -e s.test.c
    1.3
    new delta 1.4
    67 lines
      
    li
    p.test.c s.test.c test.c
    The get command produces two new files, p.test.c and test.c. The editable file is test.c. The p.test.c file is a temporary, uneditable file used by SCCS to keep track of file versions. It will disappear when you update your changes to the SCCS file. Notice also that the get command prints the SID of the version built for editing, the SID assigned to the new delta when you update your changes, and the number of lines in the file.
  2. Use any editor to edit test.c, for example:
    ed test.c
    You can now work on your actual file. Edit this file as often as you wish. Your changes will not affect the SCCS file until you choose to update it.
  3. To edit a specific version of an SCCS file with multiple versions, enter the get command with the -r flag :
    get -r1.3 s.test.c
    1.3
    67 lines
      
    get -r1.3.1.4 s.test.c
    1.3.1.4
    50 lines

Updating an SCCS File

delta Adds a set of changes (deltas) to the text of an SCCS file.
  1. To update the SCCS file and create a new delta with the changes you made while editing, use the delta command:
    $delta s.test.c
    Type comments, terminated with EOF or a blank line:
  2. The delta command prompts you for comments to be associated with the changes you made. For example, enter your comments, and then press the Enter key twice:
    No id keywords (cm7)
    1.2
    5 lines inserted
    6 lines deleted
    12 lines unchanged
    The delta command updates the s.prog.c file with the changes you made to the test.c file. The delta command tells you that the SID of the new version is 1.2, and that the edited file inserted 5 lines, deleted 6 lines, and left 12 lines unchanged from the previous version.

Related Information

sccsfile file format

admin command, delta command, and get command


[ Previous | Next | Contents | Glossary | Home | Search ]