Closed KrisThielemans closed 3 years ago
@DANAJK could you check if the following gives similar output to the stored md5
md5 -r PTB_ACRPhantom_GRAPPA.zip
If so, the following would be a replacement I believe, so could you check that as well?
md5 -r PTB_ACRPhantom_GRAPPA.zip | diff -q PTB_ACRPhantom_GRAPPA.zip.md5
# check in terminal
echo $?
the latter should print 0
. If it does, we want to check with a wrong file as well
md5 -r PTB_ACRPhantom_GRAPPA.zip.md5 | diff -q PTB_ACRPhantom_GRAPPA.zip.md5
# check in terminal
echo $?
should print 1
In a Mac terminal, md5 -r PTB_ACRPhantom_GRAPPA.zip
gives a7e0b72a964b1e84d37f9609acd77ef2 PTB_ACRPhantom_GRAPPA.zip
which seems to correspond correctly to the file PTB_ACRPhantom_GRAPPA.zip.md5
However, I don't seem to be able to correctly pipe to diff
(maybe the output from md5 is not a file?):
(base) davidatkinson@Davids-MacBook-Pro devel % md5 -r PTB_ACRPhantom_GRAPPA.zip | diff -q PTB_ACRPhantom_GRAPPA.zip.md5
diff: missing operand after `PTB_ACRPhantom_GRAPPA.zip.md5'
diff: Try `diff --help' for more information.
ok, what about
md5 -r PTB_ACRPhantom_GRAPPA.zip > test.md5
diff -q test.md5 PTB_ACRPhantom_GRAPPA.zip.md5
Yes, that works, along with the echo $?
Noticed by @DANAJK .
searching online finds lots of links that
md5
outputs the hash, but nothing that checks the md5. sigh