diff options
Diffstat (limited to 'Master/texmf-dist/source/eplain/base/add-date')
-rw-r--r-- | Master/texmf-dist/source/eplain/base/add-date | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/eplain/base/add-date b/Master/texmf-dist/source/eplain/base/add-date new file mode 100644 index 00000000000..8465939b5b8 --- /dev/null +++ b/Master/texmf-dist/source/eplain/base/add-date @@ -0,0 +1,28 @@ +#!/bin/sh +# This file is public domain. + +# Change placeholders to variations on the current date. Assumes +# various % constructs are recognized. + +if test $# -lt 1 +then + echo "Usage: $0 [<file> <file> ...]" + exit 1 +fi + +temp=${TMPDIR-/tmp}/adddate$$ + +for f in "$@"; do + sed -e s/REPLACE-WITH-MONTH-YEAR/"`date +'%B %Y'`"/ \ + -e s/REPLACE-WITH-DAY-MONTH-YEAR/"`date +'%e %B %Y'`"/ \ + -e s/REPLACE-WITH-DATE/"`date`"/ \ + <$f >$temp + if cmp -s $f $temp; then + echo "$f: No REPLACE-WITH-<date>." + exit 1 + fi + rm -f $f + mv $temp $f +done + +rm -f $temp |