]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - crontab.d/update.sh
Don't use echo for data from the user.
[config/dotfiles.git] / crontab.d / update.sh
index 173142ec214db7ddb29eed6ec690704ced1a97ed..72422fc90390e3c767eddfacd5fc676045eae484 100755 (executable)
@@ -50,7 +50,8 @@ echo "###################################"  > "$CRONTAB"
 echo "$HEADER_WARNING"                     >> "$CRONTAB"
 echo "###################################" >> "$CRONTAB"
 echo >> "$CRONTAB"
-echo "# It was generated from '$DIRECTORY/*' on `date -R`." >> "$CRONTAB"
+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
@@ -63,11 +64,9 @@ for file in "$DIRECTORY"/crontab.*; do
         break
     fi
 
-    echo "Found '$file'."
+    printf "Found '%s'.\n" "$file"
 
-    echo             >> "$CRONTAB"
-    echo             >> "$CRONTAB"
-    echo "## $file:" >> "$CRONTAB"
+    printf '\n\n## %s:\n' "$file" >>"$CRONTAB"
 
     # Strip licenses, multiple empty lines and fix $HOME variables in PATH
     # (cron doesn't expand variables).