简体   繁体   中英

A script to delete and write over a file

I've been using this script on a previous intall of 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)

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.

未安装Debian软件包secure-delete

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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