Re:What Is the Randomart Image For?
by johnmaguire on Tuesday February 21, 2023 @11:50AM
(#34883366)
Something like this also works:
I use that little if-statement in some build systems.
[ Parent
| on HN ]
See my edit, apparently shasum's -c can read from stdin so you could simplify your scriptlet even further :)
Indeed,
echo '98ea6e4f216f2fb4b69fff9b3a44842c38686ca685f3f55dc48c5d3fb1107be4 some_file' | sha256sum -c
also works (with and without passing `-n` to echo, because the `-c` option ensures the file is checked without even noticing any new line). Thanks :)