Help please.
Assuming I have this file:
Code:
/tmp/dir001/somefile.foo.gz
and I need to rename it to it's md5sum, if it didn't had an extersion I would have done it like this:
Code:
for i in *; mv "$i" `md5sum "i$" | cut -d ' ' -f 1`; done
But I need to keep the last extersion, i.e. I need it to be names [md5sum-goes-here].foo.gz
How can this be done ?
Thank you for helping,
Maxim.