1823725 Members
3351 Online
109664 Solutions
New Discussion юеВ

SCCS how-to

 
Craig A. Sharp
Super Advisor

SCCS how-to

I am looking for a how-to or some information on using the sccs system that is part of HPUX.

Any help would be greatly appreciated.

Thanks,

Craig
3 REPLIES 3
Geoff Wild
Honored Contributor

Re: SCCS how-to

How about?

man sccs



I use RCs:

RCS is a set of utilities which will allow you to backup and retrieve
versions of a file, as well as share them with others without clobbering
each others' work. This accomplished by "surrendering" your files to
the RCS system, and then asking RCS to get them for you whenever you want them. RCS is a little like using the public library: to "borrow"
a file, you "check it out"; when you are done with it you "check it in".
Using RCS is very easy -- you only need to learn 2 commands, and only
one option!


SUMMARY of RCS commands:

co check-out a read-only copy of the file. This command always
succeeds if the file exists in RCS, and gives you the latest
version that has been checked-in.

co -l check-out a read/write copy of the file and lock it so noone
else can make changes to it. This command fails if someone else
has the file locked.

ci check-in a read/write version of the file which has already been
locked by you. RCS removes your read/write version of the file,
to emphasize that it now has the file. This command is also
used to give a new file to RCS.

rlog list information about the file

rcs -u unlock a file without checking it in.


Practical Example

Ok, lets say you've got a handful of sysadmins administrating one HP-UX machine. RCS is a decent way of keeping people from stepping on toes. Lets get things rolling with something like this:

# cd /usr/local/bin# mkdir RCS

Lets continue by adding a $Header$ and a $Log$ tag to the file. Crack open your TextEditorOfChoice and add the following to the top of a file
# $Header$
# $Log$

These are RCS tags, and will by modified by RCS everytime you check a file in. Go ahead and initially register the file in the RCS repository.
# ci -u testfile
RCS/testfile,vinitial revision: 1.1
enter description, terminated with ^D or '.':
NOTE: This is NOT the log message!
>> This is a test file
>> .
done

Now we've created a RCS repository, and initialized a file into it. We use the "-u" flag which leaves a copy in the working directory. Now, through some unknown form of magic, the $Header$ and $Log$ tags have been changed to something along these lines:
# $Header: testfile,v 1.1 2004/05/27 08:50:26 root Exp $
# $Log: testfile,v $
# Revision 1.1 2004/05/27 04:12:26 root ()
# Initial revision
#

Amazing isn't it? Now the only major catch is, you HAVE to check-out (co) and LOCK the file before you make any changes to it, like so:
# co -l testfile
RCS/testfile,v --> testfile
revision 1.1 (locked)
done

This is where you whip out TextEditorOfChoice and go to town on your modifications. Once done, be sure to check the file back in, and in this case you WILL want to use the "-u" flag again. So after edits are made and tested, and your completely satisfied with them, check-in the files.
# ci -u testfile
RCS/testfile,v <-- testfile
new revision: 1.2; previous revision: 1.1
enter log message(terminate with ^D or single '.')
>> Added stuff
>> .
done

Once again, the RCS tags have magically been changed, here is the full output of the example file before and after!
2.1 Revision 1.1
# $Header: testfile,v 1.1 2004/05/27 08:50:26 root Exp $
# $Log: testfile,v $
# Revision 1.1 2004/05/27 08:50:26 root ()
# Initial revision
#

2.2 Revision 1.2
# $Header: testfile,v 1.1 2004/05/27 08:50:26 root Exp $
# $Log: testfile,v $
# Revision 1.2 2004/05/27 08:55:26 root ()
# Added stuff #
# Revision 1.1 2004/05/27 08:50:26 root ()
# Initial revision
#


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Deoncia Grayson_1
Honored Contributor

Re: SCCS how-to

a link for more info on SCCS

http://docs.hp.com/en/B2355-90690/sccs.1.html
If no one ever took risks, Michelangelo would have painted the Sistine floor. -Neil Simon
A. Clay Stephenson
Acclaimed Contributor

Re: SCCS how-to

This should tell you everything you need to know. I originally learned on SCCS under REAL UNIX (from AT&T) and later switched to RCS. Chapter 4 is devoted to SCCS.

http://www.oreilly.com/catalog/rcs/chapter/ch04.html
If it ain't broke, I can fix that.