diff options
author | NRK <nrk@disroot.org> | 2021-08-27 15:11:58 +0600 |
---|---|---|
committer | NRK <nrk@disroot.org> | 2021-08-27 15:11:58 +0600 |
commit | d39308d95cc34b05f91e5f0386f5a9b69ed525fb (patch) | |
tree | bb4aecd3c41cc1a7ec55852eed379866e2eef04b | |
parent | 51d3afc62142d2ead59173200f3d0b03a545a5ea (diff) | |
download | ranger-d39308d95cc34b05f91e5f0386f5a9b69ed525fb.tar.gz |
sxiv-rifle: use parameter expansion instead of cut
-rwxr-xr-x | examples/rifle_sxiv.sh | 4 |
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 |