From cd937192306e83e324ce28c673076e1b13e07598 Mon Sep 17 00:00:00 2001 From: guraga Date: Mon, 21 Jan 2019 15:29:16 +0700 Subject: Update "examples/find-lowres" Convert "examples/find-lowres" from "zsh" script to "sh" script. --- examples/find-lowres | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'examples/find-lowres') 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 -- cgit v1.2.3