about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-11-15 21:24:13 +0100
committerhut <hut@lavabit.com>2011-11-15 21:24:13 +0100
commitbd156f5c939505c9a7ec2fc4f48242719887de6f (patch)
tree5c2f521e099d6e0438a8a2ad7a83c8d4a49d52e5
parenta514859b91df995fb983bbae866653ee7b83e795 (diff)
downloadranger-bd156f5c939505c9a7ec2fc4f48242719887de6f.tar.gz
data/scope.sh: shorter way of getting file extension
-rwxr-xr-xranger/data/scope.sh2
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