diff options
author | hut <hut@lavabit.com> | 2011-11-15 21:24:13 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2011-11-15 21:24:13 +0100 |
commit | bd156f5c939505c9a7ec2fc4f48242719887de6f (patch) | |
tree | 5c2f521e099d6e0438a8a2ad7a83c8d4a49d52e5 | |
parent | a514859b91df995fb983bbae866653ee7b83e795 (diff) | |
download | ranger-bd156f5c939505c9a7ec2fc4f48242719887de6f.tar.gz |
data/scope.sh: shorter way of getting file extension
-rwxr-xr-x | ranger/data/scope.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index aeb47a13..ed4f01e1 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -26,7 +26,7 @@ maxln=200 # Stop after $maxln lines. Can be used like ls | head -n $maxln # Find out something about the file: mimetype=$(file --mime-type -Lb "$path") -extension=$(echo "$path" | grep '\.' | grep -o '[^.]\+$') +extension=${path##*.} # Functions: # "have $1" succeeds if $1 is an existing command/installed program |