######################################################################## # # # This software is part of the ast package # # Copyright (c) 1999-2011 AT&T Intellectual Property # # and is licensed under the # # Eclipse Public License, Version 1.0 # # by AT&T Intellectual Property # # # # A copy of the License is available at # # http://www.eclipse.org/org/documents/epl-v10.html # # (with md5 checksum b35adb5213ca9657e911e9befb180842) # # # # Information and Software Systems Research # # AT&T Research # # Florham Park NJ # # # # Glenn Fowler # # # ######################################################################## # # addition date.dat test generator # now=2008-05-01+01:02:03 regress=$1 if [[ $regress ]] then printf $'%s\t\t\t\t\t%s\t%s\n' "SET" "NOW" "$now" fi while read d do if [[ $d ]] then # printf $'%T %s\n' "$d" "$d" if [[ $regress ]] then width=${#d} if (( width < 8 )) then sep=$'\t\t\t\t\t' elif (( width < 16 )) then sep=$'\t\t\t\t' elif (( width < 24 )) then sep=$'\t\t\t' elif (( width < 32 )) then sep=$'\t\t' else sep=$'\t' fi if [[ $d == +([a-z])day ]] then printf $'%s%sNULL\t%s\n' "$d" "$sep" "$(date -s "$now $d" | tail -1)" else printf $'%s%sNULL\t%s\n' "$d" "$sep" "$(date -s "$now" "$d" | tail -1)" fi else printf $'%s %s\n' "$(date -s "$now" "$d" | tail -1)" "$d" fi else printf $'\n' fi done <