summaryrefslogtreecommitdiff
path: root/duplicates
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2017-07-05 09:17:22 +0200
committerPatrick Simianer <p@simianer.de>2017-07-05 09:17:22 +0200
commita2a68fa25e257a3b8b2c93235c51ad8b37bd63ba (patch)
tree343a7cfc3e2c7d0cc8dfa157ca13fa1249db31ff /duplicates
parent4d09a9128fd5ed971242d6c3d5ca86565fbf2332 (diff)
duplicates: bugfix
Diffstat (limited to 'duplicates')
-rwxr-xr-xduplicates8
1 files changed, 4 insertions, 4 deletions
diff --git a/duplicates b/duplicates
index 8be99f9..208432a 100755
--- a/duplicates
+++ b/duplicates
@@ -3,14 +3,14 @@
dir = ARGV[0]
a = `find #{dir} -type f`.split "\n"
-md5 = "md5sum"
-if `uname` == "Darwin"
- md5 = "md5"
+md5cmd = "md5sum"
+if `uname`.strip == "Darwin"
+ md5cmd = "md5"
end
h = {}
a.each { |fn|
- md5 = `#{md5} "#{fn}" | cut -d " " -f1`
+ md5 = `#{md5cmd} "#{fn}" | cut -d " " -f1`
if h.has_key? md5
h[md5] << fn
else