made safe for names with spaces
authorChris Koeritz <fred@gruntose.com>
Mon, 21 May 2018 20:34:17 +0000 (16:34 -0400)
committerChris Koeritz <fred@gruntose.com>
Mon, 21 May 2018 20:34:17 +0000 (16:34 -0400)
scripts/pictures/shrink_pics.sh

index d4b442d5f00681ecf324bdab43ef371486f98038..941f79720f1942e13b7728c38457a2720804b3f6 100644 (file)
@@ -11,7 +11,11 @@ fi
 
 percentage="$1"; shift
 
-for i in $*; do
-  mogrify -resize $percentage% $i;
+while true; do
+  picname="$1"; shift
+  if [ -z "$picname" ]; then
+    break
+  fi
+  mogrify -resize "$percentage%" "$picname";
 done