#!/bin/sh # the code in this file will define a number of macros to match # the dates of today, yesterday (YESTR) and the day before yesterday (DBFYS) # in various formats # If you need other formats, please file a bug against aide-common FORMATS="%Y%m%d %y%m%d %Y-%m-%d %y-%m-%d" DATES="now 1_day_ago 2_days_ago" while read -r var format dt; do dt="${dt# }" # optional, trim leading space printf "@@define DATE_%s %s\n" "${var}" "$(date +"${format}" --date="${dt}")" done <