I am executing the below command in bash
filehash=`openssl dgst -sha1 $filename`
When I echo $filehash
I get this
SHA1(myfile.csv)= bac9c755bac9709fa8966831d1731dff07e28e6c
How do I only get the hash value stored and not the rest of the string i.e.
bac9c755bac9709fa8966831d1731dff07e28e6c
Through sed
,
filehash=`openssl dgst -sha1 $filename | sed 's/^.*= //'`
It removes all the characters upto the =
(equal symbol followed by a space).