diff options
-rwxr-xr-x | duplicates | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |