. , . Debian/Ubuntu "whirlpool". . apt-cache search whirlpool , , md5deep.
. , , \n .
oldifs="$IFS"
IFS="
"
for i in $(find -type f); do echo "$i";done
IFS="$oldifs"
IFS, , .
- IFS = "."; find -print0 | - , "." , . , man, ( , .) bash , , , perl ! gotchas :
http://tldp.org/LDP/abs/html/gotchas.html#BADREAD0
, : find -exec sh -c. , .
:
find -regextype posix-extended -type f -not -regex '.*\.[a-fA-F0-9]{128}.*' \
-execdir bash -c 'for i in "${@#./}";do
hash=$(whirlpool "$i");
ext=".${i##*.}"; base="${i%.*}";
[ "$base" = "$i" ] && ext="";
newname="$base.$hash$ext";
echo "ext:$ext $i -> $newname";
false mv --no-clobber "$i" "$newname";done' \
dummy {} +
-execdir bash -c 'cmd' dummy {} + , arg $0 , "$ @", . execdir exec, ( PATH_MAX dirs , .)
-not -regex . , mv , , . ( XFS.)
basename.hash. , . ${@#./} . /, , . .
mv --no-clobber GNU. GNU mv, - , (, , , .) OTOH, , .
, ( , !) . perl, .
wallenborn ( ) , . md5sum , , :
dir- f -print0 | xargs -0 md5sum > dir.md5
GNU find, xargs ( + ';')
find dir -type f -exec md5sum {} + > dir.md5
find -print | xargs -d '\n', , . , script, print0 -exec. . true, (.. .)