diff options
author | NRK <nrk@disroot.org> | 2021-08-27 15:08:42 +0600 |
---|---|---|
committer | NRK <nrk@disroot.org> | 2021-08-27 15:08:42 +0600 |
commit | 51d3afc62142d2ead59173200f3d0b03a545a5ea (patch) | |
tree | 9af35ad12f4c07fe0fc98b1e2e15dff4999cec18 | |
parent | c47c0f3216fddedfb8099adbb98eece41f8ec040 (diff) | |
download | ranger-51d3afc62142d2ead59173200f3d0b03a545a5ea.tar.gz |
sxiv-rifle: don't grep if $target is not a file
-rwxr-xr-x | examples/rifle_sxiv.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/rifle_sxiv.sh b/examples/rifle_sxiv.sh index d0b5058f..5fab6b78 100755 --- a/examples/rifle_sxiv.sh +++ b/examples/rifle_sxiv.sh @@ -31,7 +31,7 @@ case "$1" in *) target="$PWD/$1" ;; esac -count="$(listfiles | grep -m 1 -ZznF "$target" | cut -d: -f1)" +[ -f "$target" ] && count="$(listfiles | grep -m 1 -ZznF "$target" | cut -d: -f1)" if [ -n "$count" ]; then listfiles | xargs -0 sxiv -n "$count" -- |