I've I need to automate the creation of sha512 hash. I'm fairly new to bash scripting and none of the things I've read have helped me much.
This line gives me the correct hash and assigns nothing to $hashed
echo -n thingToHash | openssl dgst -sha512 -out $hashed;
This line gives me the wrong hash and also assigns nothing to $hashed
$hashed= thingToHash | openssl dgst -sha512;
I've tried several other things with similar results.