Trying to calculate md5 hash of all *.txt
files in directory and store each in same filename but with extension replaced from .txt
to .md5
.
For file: foo.txt
i want to create file: foo.md5
with content:
9fa74bee342222aadd999b2e8b2bef62 *foo.txt
I have managed to get needed files with command below, but I wonder is there some much shorter alternative, or at least a way to drop one or two awk
commands?
time find *.txt | parallel md5sum | awk '{ print $1, $2, $2 }' | awk '{$1 $2 $3 > gsub(".txt", ".md5", $3); print}' | awk '{ print $1, "*"$2 > $3 }'
I have found some alternatives, but they don't use parallel and the just add .md5 to filename, not replace it. Also they store only md5 hash, I need this *filename
modification.
.txt
, I would still go withfile.ext.md5
instead offile.md5
)