Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcs!utfyzx!sq!dave From: dave@sq.UUCP Newsgroups: net.unix,net.text Subject: Re: How to obtain file date rather than current date Message-ID: <1986Oct9.140927.17745@sq.uucp> Date: Thu, 9-Oct-86 14:09:27 EDT Article-I.D.: sq.1986Oct9.140927.17745 Posted: Thu Oct 9 14:09:27 1986 Date-Received: Wed, 15-Oct-86 05:23:19 EDT References: <4353@brl-smoke.ARPA> <1986Oct8.182034.4245@sq.uucp> Reply-To: dave@sq.UUCP (David Seaman) Organization: SoftQuad Inc., Toronto Lines: 37 Xref: utcs net.unix:9499 net.text:1430 Checksum: 17172 In article <1986Oct8.182034.4245@sq.uucp> dave@sq.UUCP I write: > The following troff macro, gR (GetReviseTime), assigns the latest > revision-date of the file in which it appears to the string whose name > is the argument in a call to gR: > > .de gR > .sy echo ".ds \\$1 `ls -l \n(.F | awk '{print $5, $6, $7}'`">/tmp/date\n($$ > .so /tmp/date/\n($$ > .sy rm /tmp/date\n($$ > > After the above, in the file which is being formatted by ms, the > following: > > .gR dR > \*(dR > > would place the respective date in the output. It also works independent > of the ms macros. > > Note: the .sy request is available in DWB and ditroff. Sorry folks. (Apologies in particular to beginners.) The macro definition, above (gR), contains two typos: 1. There should be a line ".." at the bottom, to end the definition. 2. An extra forward-slash appears in the ".so ..." line following the word "date". The true definition is: .de gR .sy echo ".ds \\$1 `ls -l \n(.F | awk '{print $5, $6, $7}'`">/tmp/date\n($$ .so /tmp/date\n($$ .sy rm /tmp/date\n($$ ..