用于删除和写入文件的脚本

时间:2014-01-21 15:09:46

标签: linux bash scripting

我一直在以前的Debian中使用这个脚本。我的新安装不是更新的版本(继续测试),但是当我运行它时,我收到错误消息“删除$ {*}时出错。”

#!/bin/bash
if zenity --question \
    --text "Do you really want to delete ${*} and write over it?" \
    --title "Delete and write over file"; then
  srm -r -l "$@" && \
  zenity --info --text "${*} has been deleted" \
      --title "Delete and write over file" ||
  zenity --error \
      --text "An error has occured while deleting ${*}." \
      --title "Delete and write over file"
fi

它来自这里:https://guide.boum.org/tomes/1_hors_connexions/unepage/#index75h3(法语)

正如标题所说,目标是删除然后写一个文件,以确保文件已被“真正”删除。

我以前从来没有打过脚本,我认为可能有一个更新/版本的问题打破了脚本,因为它已经很老了。

1 个答案:

答案 0 :(得分:0)

未安装Debian软件包secure-delete

相关问题