![]() Which indicates that it matched line 2 in the. I used mint_sha256sum.txt as a file of correct hashes to check from like they give for here, it should give outputĢ:50b833f1f093c029bfb7ba6148c9ce96619c01a83e92f35287983fbd62f26b01 On Mac: check=$(shasum -a 256 -b ) check_escaped_space=$(echo $check | sed 's/ / \\/') grep $check_escaped_space mint_sha256sum.txt -n On Linux: check=$(sha256sum -b ) check_escaped_space=$(echo $check | sed 's/ / \\/') grep $check_escaped_space mint_sha256sum.txt -n The true hash of the string 'blah' is the 2nd call. When echoing strings to any of the hash functions like md5 or sha256sum it's generally best to do an echo -n which tells echo to omit appending a newline at the end of the string. This likely failed because when you use echo you introduced an additional character, a newline ( \n) which altered the checksum string. With respect to why this wasn't working for you when you attempted it. So your only option here is to copy/paste the output from the previous command. (Simply attempting to use grep on a double‐quoted pasted checksum (i.e., as a string) doesn't work.) Q2: I'd like to know the simplest way to do this using a command that does require copy and pasting of the first output's checksum. You have to capture it explicitly if you intend to act on it in any subsequent commands. Q1: I'd like to know how to do this using a command that does not require copy and pasting of the first output's checksum (if it's possible).īash provides no mechanism to recall any output from the previously run command.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |