]> ruderich.org/simon Gitweb - config/dotfiles.git/blobdiff - lib.sh
Always use single quotes for printf format string
[config/dotfiles.git] / lib.sh
diff --git a/lib.sh b/lib.sh
index 6df53110c3e39b60416a9c9ce6d05abe4257d619..6a619027db7e7ae1046a66be85f9b1102fc3ab3b 100644 (file)
--- a/lib.sh
+++ b/lib.sh
@@ -151,19 +151,19 @@ link() {
     # Abort if the target file exists and is no symbolic link. Prevents
     # overwriting real files.
     if test -e "$target" && test ! -h "$target"; then
-        printf "link(): target '%s' exists already and is no symbolic link!\n" \
+        printf 'link(): target "%s" exists already and is no symbolic link!\n' \
                "$target" >&2
         exit 1
     fi
 
     # Make sure the source exists.
     if test ! -e "$source"; then
-        printf "link(): source '%s' doesn't exist!\n" "$source" >&2
+        printf 'link(): source "%s" does not exist!\n' "$source" >&2
         exit 1
     fi
 
     # Create the new symbolic link; remove the old one if necessary.
-    printf "link(): linking '%s' to '%s'\n" "$source" "$target"
+    printf 'link(): linking "%s" to "%s"\n' "$source" "$target"
     rm -f "$target"
     ln -s "$source" "$target"
 
@@ -193,14 +193,14 @@ generate() {
         file_tmp="$file.tmp"
     else
         # We only need this message if we generate a new file.
-        printf "%s: generating from '%s' (%s)\n" \
+        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" \
+        printf '# It was generated from "%s" on %s.\n' \
             "$file$extension" "`date`" >>"$file"
         echo >>"$file"