printf '%s: generating from "%s" (%s)\n' \
"$file" "$file$extension" "$1"
- echo '###################################' >"$file"
- echo '# WARNING! DO NOT EDIT THIS FILE! #' >>"$file"
- echo '###################################' >>"$file"
- echo >>"$file"
- printf '# It was generated from "%s" on %s.\n' \
- "$file$extension" "`date`" >>"$file"
- echo >>"$file"
+ {
+ echo '###################################'
+ echo '# WARNING! DO NOT EDIT THIS FILE! #'
+ echo '###################################'
+ echo
+ printf '# It was generated from "%s" on %s.\n' \
+ "$file$extension" "`date`"
+ echo
+ } > "$file"
file_tmp="$file"
fi
# `set -e` aborts when `mktemp` fails.
CRONTAB=`mktemp --tmpdir="$DIRECTORY" update-crontab.XXXXXXXXXXXX`
-echo '###################################' >"$CRONTAB"
-echo "$HEADER_WARNING" >>"$CRONTAB"
-echo '###################################' >>"$CRONTAB"
-echo >>"$CRONTAB"
-printf '# It was generated from "%s/*" on %s.' \
- "$DIRECTORY" "`LANG=C date '+%a, %d %b %Y %H:%M:%S %z'`" >>"$CRONTAB"
+{
+ echo '###################################'
+ echo "$HEADER_WARNING"
+ echo '###################################'
+ echo
+ printf '# It was generated from "%s/*" on %s.' \
+ "$DIRECTORY" "`LANG=C date '+%a, %d %b %Y %H:%M:%S %z'`"
+} > "$CRONTAB"
# Enforce C sort order.
LC_ALL=C