I’ve just released Hash’em all: a Bash script which substitutes recursively the content of the files of a folder with their own sha1sum (changing it to compute a different chechsum is pretty trivial of course). It is a modified version of the already hacked script written by Kaz Kylheku.
As Kaz wrote in 2000:
What is nice about this is that you can embed the function into your shell script. The function changes the current working directory as it descends. So it can handle arbitrarily deep paths. Whereas paths generated by the
findcommand can cause a problem when they get too long; the kernel has a hard limit on the length of the string passed to theopen()and other system calls.
It uses sponge from the lovely moreutils tools… and no, the name of the script is not a tribute to the well known trash metal album. ![]()
If you enjoyed this post, make sure you subscribe to my RSS feed!