groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] [PATCH] mdate.sh: rewrite in Perl


From: James K. Lowden
Subject: Re: [Groff] [PATCH] mdate.sh: rewrite in Perl
Date: Sat, 18 Feb 2017 13:07:38 -0500

On Sat, 18 Feb 2017 03:28:03 +0000
Colin Watson <address@hidden> wrote:

> This version is much shorter and easier to understand than the
> shell/awk version: we don't have to worry about convincing ls to
> produce output that we can parse, and we don't have to play games
> with the way that the same field may contain either the year or the
> time depending on how old the file is.

Attached please find fdate.c. It accepts filename argments and prints
the files' mtimes (and, optionally, names).  Like date(1), it accepts a
strftime format argument, defaulting to yyyy-mm-dd.

If you would like to use it instead, i can provide the necessary GNU
paperwork.  

$ fdate ~/projects/3/groff/*
2016-04-21
2013-11-12
2016-04-19

$ fdate -v +'%d %B %Y' ~/projects/3/groff/*
21 April 2016 /home/jklowden/projects/3/groff/groff
12 November 2013 /home/jklowden/projects/3/groff/mkgrft
19 April 2016 /home/jklowden/projects/3/groff/sidebar

--jkl

Attachment: fdate.c
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]