← Back to team overview

geda-developers team mailing list archive

Re: geda-gaf on FreeBSD and probably other architectures

 

On 2015-07-14 15:09, Vladimir Zhbanov wrote:
OK, the line in question was
  d=`LANG=C date -d $(DATE_VERSION) "+%B %-d, %Y"` ; \

I've written two scripts, one is combination of sed and awk:

  echo DATE_VERSION | sed 's/\(....\)\(..\)\(..\)/\1 \2 \3 00 00 00/' |
                      LANG=C awk '{print (strftime ("%B %-d, %Y",
mktime ($0)))}'

and the other is in Guile:

  (setlocale LC_ALL "C")
  (display
    (strftime "%B %-d, %Y"
      (car (strptime "%Y%m%d" (cadr (program-arguments))))))

which will be invoked then something like this
  guile date.scm DATE_VERSION


Which would be better to use?

The guile version is a bit more readable, I think.  :-)

                             Peter


--
Dr Peter Brett <peter@xxxxxxxxxxxxx>


Follow ups

References