From 563c91d0e7636935106919ea4b1962a48c2b973b Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Mon, 21 May 2018 16:34:17 -0400 Subject: [PATCH] made safe for names with spaces --- scripts/pictures/shrink_pics.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/pictures/shrink_pics.sh b/scripts/pictures/shrink_pics.sh index d4b442d5..941f7972 100644 --- a/scripts/pictures/shrink_pics.sh +++ b/scripts/pictures/shrink_pics.sh @@ -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 -- 2.34.1