RCS and SCCS

Bob Goudreau goudreau at xyzzy.UUCP
Sun Aug 7 08:21:30 AEST 1988


In article <1207 at dragon.UUCP> charles at dragon.UUCP (Charles Wolff, 602 438-3432) writes:

>we did come across an interesting problem with sccs today... we had a
>shell script in one of our utilities where the author (are you reading
>this, Fred Fish?) wanted to capture the current date and time in a format
>suitable to use with the "touch" command, so he did something like:
>
>	DATE_TOUCH=`date +%m%d%H%M%y`
>
>when we checked it into and back out of the sccs source base however,
>something happened... sccs saw %H% in the middle of the line and decided
>that was an SCCS significant string... so on checking out the file,
>converted it to the current date in MM/DD/YY format. 

I once ran into a very similar problem: a date command in an SCCS
archived makefile.  The solution was simple -- define a make variable
named PCT that consisted solely of the string "%" and replace all %'s
that could cause trouble with $(PCT).  That way, no SCCS keywords
at all were present in the makefile.  This method can also be used in
shell scripts, of course:

	PCT=%
	DATE_TOUCH=`date +${PCT}m${PCT}d${PCT}H${PCT}M${PCT}y`

A hack, admittedly, and it decreases the readability of the shell
script, but it keeps SCCS from munging your source.
-- 
	Bob Goudreau
	Data General Corp.,  62 Alexander Drive,
	Research Triangle Park, NC  27709
	(919) 248-6231
	{ihnp4, seismo, etc.}!mcnc!rti!xyzzy!goudreau
	goudreau at dg-rtp.dg.com



More information about the Comp.unix.questions mailing list