I'm encountering an error when I try and run md5sum -c
on a checksum file I generated. I should mention that I'm running this from PowerShell (as a script will be running this eventually) and this is the cygwin version of md5sum
.
I have a test file, jira_defect.txt
and I've created a checksum like this:
md5sum jira_defect.txt > result.md5
This gives a file with the following:
7d559b59459052f274e290b5e01a5485 *jira_defect.txt
But when I run
md5sum -c result.md5
I get the infamous error message
result.md5: no properly formatted MD5 checksum lines found
I've tried this again with the -t
option, which removes the asterisk, but this hasn't made a difference.
Using the redirection operator to write the checksums to an output file causes the file to be created with the default encoding (Unicode).
md5sum
expects an ASCII file. UseSet-Content
(orOut-File
) to save the file with ASCII encoding:You can also work with Unicode files if you pipe their content into
md5sum
:Demonstration: