GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
1
Issues
4
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
nigel.stanger
/
hashdiff
Browse code
Added "" around paths (closes
#5
)
master
1.0
1 parent
4a6d613
commit
efdd79cffcf09ad05384730a19f24b15c91c88b6
Nigel Stanger
authored
on 27 Nov 2020
Patch
Showing
1 changed file
hashdiff
Ignore Space
Show notes
View
hashdiff
#!/usr/bin/env bash # Compare two files by hash. # Based on http://alanwsmith.com/command-line-one-liner-to-compare-files-with-md5 # Future enhancements: # * different hashes # * "paranoid" mode (use several different hashes) # * compare more than two files # * verbose: print out hashes if different file1=$1 file2=$2 if [ $(md5 -q "${file1}") == $(md5 -q "${file2}") ] then echo "identical" else echo "different" fi
#!/usr/bin/env bash # Compare two files by hash. # Based on http://alanwsmith.com/command-line-one-liner-to-compare-files-with-md5 # Future enhancements: # * different hashes # * "paranoid" mode (use several different hashes) # * compare more than two files # * verbose: print out hashes if different file1=$1 file2=$2 if [ $(md5 -q ${file1}) == $(md5 -q ${file2}) ] then echo "identical" else echo "different" fi
Show line notes below