简体   繁体   English

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

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

I've been using this script on a previous intall of Debian. 我在Debian的先前版本中一直使用此脚本。 My new install is not a newer version (kept testing), but when I run it I get the error message "An error has occured while deleting ${*}." 我的新安装不是较新的版本(经过测试),但是运行它时,出现错误消息“删除$ {*}时发生错误”。

#!/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

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

As the title says, the goal is to delete and then write over a file to be sure the file has been "really" deleted. 如标题所述,目标是删除然后覆盖文件,以确保已“确实”删除了该文件。

I've never bash scripted before and I thought there might be a question of update/version that breaks the script since it's quite old. 我以前从未对脚本进行过bash调试,并且我认为可能存在一个更新/版本问题,因为该脚本很旧,因此会破坏脚本。

未安装Debian软件包secure-delete

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

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