Path: utzoo!attcan!uunet!husc6!rutgers!mcnc!rti!xyzzy!goudreau From: goudreau@xyzzy.UUCP (Bob Goudreau) Newsgroups: comp.unix.questions Subject: Re: RCS and SCCS Message-ID: <992@xyzzy.UUCP> Date: 6 Aug 88 22:21:30 GMT References: <890@fig.bbn.com> <710@ubu.warwick.UUCP> <661@pyuxe.UUCP> <29953@cca.CCA.COM> <1023@unccvax.UUCP> <8187@brl-smoke.ARPA> <3494@rpp386.UUCP> <1207@dragon.UUCP> Reply-To: goudreau@rtp48.UUCP (Bob Goudreau) Organization: Data General Corporation, Research Triangle Park, NC Lines: 32 In article <1207@dragon.UUCP> charles@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@dg-rtp.dg.com