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: <1986Oct8.182034.4245@sq.uucp> Date: Wed, 8-Oct-86 18:20:34 EDT Article-I.D.: sq.1986Oct8.182034.4245 Posted: Wed Oct 8 18:20:34 1986 Date-Received: Wed, 15-Oct-86 05:22:54 EDT References: <4353@brl-smoke.ARPA> Reply-To: dave@sq.UUCP (David Seaman) Organization: SoftQuad Inc., Toronto Lines: 31 Xref: utcs net.unix:9498 net.text:1429 Checksum: 44376 In article <4353@brl-smoke.ARPA> abrams@MITRE.arpa (Marshall D. Abrams) writes: >I am using troff with the ms macros to produce hardcopy of a file >which is getting many updates. When I print it I am using the DA >directive to get the date printed on the hardcopy. But this is the >date printed. I would much rather have the date that the file >was last revised. Any suggestion on how to do this would be >appreciated. 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. -------------------------------------------------------------- SoftQuad Toronto, Ontario, Canada (416) 963-8337 David Seaman utzoo!sq!dave