about summary refs log tree commit diff stats
path: root/examples
diff options
context:
space:
mode:
authorNRK <nrk@disroot.org>2021-08-27 15:11:58 +0600
committerNRK <nrk@disroot.org>2021-08-27 15:11:58 +0600
commitd39308d95cc34b05f91e5f0386f5a9b69ed525fb (patch)
treebb4aecd3c41cc1a7ec55852eed379866e2eef04b /examples
parent51d3afc62142d2ead59173200f3d0b03a545a5ea (diff)
downloadranger-d39308d95cc34b05f91e5f0386f5a9b69ed525fb.tar.gz
sxiv-rifle: use parameter expansion instead of cut
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/rifle_sxiv.sh4
1 files changed, 2 insertions, 2 deletions
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