summaryrefslogtreecommitdiff
path: root/examples/find-lowres
diff options
context:
space:
mode:
authorguraga <kalimai@ro.ru>2019-01-21 15:29:16 +0700
committerGitHub <noreply@github.com>2019-01-21 15:29:16 +0700
commitcd937192306e83e324ce28c673076e1b13e07598 (patch)
tree25721c6546229f9296ca1ce9c1271f3affb0fedf /examples/find-lowres
parentad6b72d38f08705c6fe8c3c5530b7f40713743e0 (diff)
Update "examples/find-lowres"
Convert "examples/find-lowres" from "zsh" script to "sh" script.
Diffstat (limited to '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