How to obtain file date rather than current date
dave at sq.UUCP
dave at sq.UUCP
Fri Oct 10 04:09:27 AEST 1986
In article <1986Oct8.182034.4245 at sq.uucp> dave at 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($$
..
More information about the Comp.unix
mailing list