for i in `find . -type f`
do
cp "${i}" "${i}.bak"
done
This fails when filenames contain spaces, as bash uses whitespace, tab and LF as the default delimiter. Solution? Do this:
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for i in `find . -type f`
do
cp "${i}" "${i}.bak"
done
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")