繁体   English   中英

用于删除和覆盖文件的脚本

[英]A script to delete and write over a file

我在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 (法语)

如标题所述,目标是删除然后覆盖文件,以确保已“确实”删除了该文件。

我以前从未对脚本进行过bash调试,并且我认为可能存在一个更新/版本问题,因为该脚本很旧,因此会破坏脚本。

未安装Debian软件包secure-delete

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM