找出清理函数里的 bug

来自 Linux
Linux 7.2.3 进阶 7分钟 找出 3处问题

找出这个生成的清理函数中的安全与正确性问题。

Shell
cleanup() {
  target=$1
  for file in $(find $target -type f -name '*.tmp'); do
    rm $file
  done
  echo "cleaned $target"
}
cleanup "$1"
在试验场中打开
报告错误