"Fossies" - the Fresh Open Source Software Archive

Member "dateutils-0.4.6/test/dconv-batch.1.sh" (19 Mar 2019, 567 Bytes) of package /linux/privat/dateutils-0.4.6.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 
    3 BEG="1917"
    4 END="4095"
    5 if test "${have_gdate_2039}" != "yes"; then
    6     BEG="1971"
    7     END="2038"
    8 fi
    9 
   10 if test "${have_gdate}" != "yes"; then
   11     ## SKIP in new automake
   12     exit 77
   13 fi
   14 
   15 TOOLDIR="$(pwd)/../src"
   16 
   17 DCONV="${TOOLDIR}/dconv"
   18 
   19 foo=`mktemp "/tmp/tmp.XXXXXXXXXX"`
   20 bar=`mktemp "/tmp/tmp.XXXXXXXXXX"`
   21 
   22 for y in `seq ${BEG} ${END}`; do
   23     "${DCONV}" "${y}-01-01" -f '%F  %a'
   24 done > "${foo}"
   25 for y in `seq ${BEG} ${END}`; do
   26     TZ=UTC LANG=C LC_ALL=C "${GDATE}" -d "${y}-01-01" '+%F  %a'
   27 done > "${bar}"
   28 
   29 diff "${foo}" "${bar}"
   30 rc=${?}
   31 
   32 rm -f "${foo}" "${bar}"
   33 
   34 exit ${rc}