On Ubuntu 14.04, sha256sum
from coreutils
works as I expected:
echo 879dd0d7637876be4796f7e6f194a111d21088be85cfe717fc97e2e7f05e79d2 /tmp/myfile | sha256sum -c
/tmp/myfile: OK
However, the exact same command with the exact same file on Debian Wheezy fails:
sha256sum: standard input: no properly formatted SHA256 checksum lines found
I don't understand this. How can I verify the checksum reliably in a shell script on Debian?
On Ubuntu 14.04:
⟫ sha256sum --version
sha256sum (GNU coreutils) 8.21
On Wheezy:
$ sha256sum --version
sha256sum (GNU coreutils) 8.13
manpages on both OSs say:
SYNOPSIS
sha256sum [OPTION]... [FILE]...
DESCRIPTION
Print or check SHA256 (256-bit) checksums. With no FILE,
or when FILE is -, read standard input.
[...]
-c, --check
read SHA256 sums from the FILEs and check them