From 50b09a4d69d87a94cd8ac607946d335a2452698f Mon Sep 17 00:00:00 2001 From: Arvid Norlander Date: Sat, 19 May 2007 16:47:52 +0000 Subject: [PATCH] Fixed a bug in the png_recompress.sh script SVN-Revision: 5004 --- tools/png_recompress.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/png_recompress.sh b/tools/png_recompress.sh index b38cb7d08..f515536a3 100755 --- a/tools/png_recompress.sh +++ b/tools/png_recompress.sh @@ -66,7 +66,7 @@ for image in "$@"; do echo -e "\e[1m$image\e[0m : $(du -b $image | awk '{print $1}')" newsize="$(pngcrush -reduce -brute -d "$TMPPATH" "$image" | grep -E "filesize reduction")" echo "$newsize" - if [[ $newsize =~ ".+reduction.+" ]]; then + if grep -q reduction <<< "$newsize"; then cp -v "${TMPPATH}/$fname" "$dname/$fname" else rm -v "${TMPPATH}/$fname" @@ -83,7 +83,7 @@ for image in "$@"; do echo -e "\e[1m$image\e[0m : $(du -b $image | awk '{print $1}')" newsize="$(optipng -i 0 -o 7 -dir "$TMPPATH" "$image" | grep -E '^Output file size')" echo "$newsize" - if [[ $newsize =~ ".+decrease.+" ]]; then + if grep -q decrease <<< "$newsize"; then cp -v "${TMPPATH}/$fname" "$dname/$fname" else rm -v "${TMPPATH}/$fname" -- 2.11.0