
Create a bash script (in my case I've called it 'cryptotest') with those commands:
#!/bin/bash
filename="filename.txt"
md5="$(md5sum "${filename}")"
md5="${md5%% *}" # remove the first space and everything after it
sha1="$(sha1sum "${filename}")"
sha1="${sha1%% *}" # remove the first space and everything after it
echo md5 = "'$md5'"
echo sha1 = "'$sha1'"
Give it execute permission:
Execute it:
obtaining:
sha1 = 'd67aef9d1a5cb5ef73bb0a028fc1bbf83c8ec718'




