Find the safety and correctness bugs in this generated cleanup function.
Shell
cleanup() {
target=$1
for file in $(find $target -type f -name '*.tmp'); do
rm $file
done
echo "cleaned $target"
}
cleanup "$1"
cleanup() {
target=$1
for file in $(find $target -type f -name '*.tmp'); do
rm $file
done
echo "cleaned $target"
}
cleanup "$1"