From d39308d95cc34b05f91e5f0386f5a9b69ed525fb Mon Sep 17 00:00:00 2001 From: NRK Date: Fri, 27 Aug 2021 15:11:58 +0600 Subject: sxiv-rifle: use parameter expansion instead of cut --- examples/rifle_sxiv.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/rifle_sxiv.sh') diff --git a/examples/rifle_sxiv.sh b/examples/rifle_sxiv.sh index 5fab6b78..5b096eaa 100755 --- a/examples/rifle_sxiv.sh +++ b/examples/rifle_sxiv.sh @@ -31,10 +31,10 @@ case "$1" in *) target="$PWD/$1" ;; esac -[ -f "$target" ] && count="$(listfiles | grep -m 1 -ZznF "$target" | cut -d: -f1)" +[ -f "$target" ] && count="$(listfiles | grep -m 1 -ZznF "$target")" if [ -n "$count" ]; then - listfiles | xargs -0 sxiv -n "$count" -- + listfiles | xargs -0 sxiv -n "${count%%:*}" -- else sxiv -- "$@" # fallback fi -- cgit 1.4.1-2-gfad0