I use md5sum to generate a hash value for a file. But i only need to receive the hash value, not the file name.
md5=`md5sum ${my_iso_file}`
echo ${md5}
3abb17b66815bc7946cefe727737d295 ./iso/somefile.iso
How can i 'strip' the file name and only remain the value ?
A simple array assignment works... Note that the first element of a bash
array can be addressed by just the name
without the [0]
index, ie, $md5
contains only the 32 chars of the md5sum.
md5=($(md5sum file))
echo $md5
# 53c8fdfcbb60cf8e1a1ee90601cc8fe2