summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@chaosdorf.de>2019-04-05 22:31:06 +0200
committerGitHub <noreply@github.com>2019-04-05 22:31:06 +0200
commite6dd09e65e22cc13692e09b0018960e878b965c7 (patch)
tree13bf54d414635d27af51c7f1f0b0ffa0eee0a8c5
parent5a2e42e05c7ff8ea4c7b8fbf47315d6008435142 (diff)
parentcd937192306e83e324ce28c673076e1b13e07598 (diff)
Merge pull request #452 from guraga/patch-3
Update "examples/find-lowres"
-rwxr-xr-xexamples/find-lowres17
1 files changed, 10 insertions, 7 deletions
diff --git a/examples/find-lowres b/examples/find-lowres
index 4a7d9a9..ac77e7b 100755
--- a/examples/find-lowres
+++ b/examples/find-lowres
@@ -1,4 +1,4 @@
-#!/usr/bin/env zsh
+#!/bin/sh
# Recursively find images below a certain resolution
#
# Usage: find-lowres [-r] [directory [dimension]]
@@ -10,20 +10,23 @@
remove=0
-while [[ $1 == -* ]]; do
+while true
+do
case $1 in
-r) remove=1 ;;
+ -*) echo "option \"$1\" ignored" ;;
-|--) shift; break ;;
+ *) break ;;
esac
shift
done
-base=${1-.}
-dimension=${2-1000x800}
+dir=${1:-.}
+dimension=${2:-1000x800}
-if (( remove ))
+if [ "$remove" = "1" ]
then
- feh --action 'rm %F' -rlV --max-dim ${dimension} ${base}
+ feh --action 'rm %F' -rlV --max-dim "${dimension}" "${dir}"
else
- feh -rlV --max-dim ${dimension} ${base}
+ feh -rlV --max-dim "${dimension}" "${dir}"
fi