Hacker News new | past | comments | ask | show | jobs | submit login

I think this would be a bit better for interactive cases. Note: written just now, I haven't actually felt the need for this safeguard... yet.

    rmrf()
    {
        (echo "The following files are going to be deleted!!!"
         for FILE in "$@"; do
             echo "<<<" "$FILE" ">>>"
         done) | less
        read -p "Are you sure? " -n 1 -r
        echo
        if [[ $REPLY =~ ^[Yy]$ ]]
        then
            rm -rf "$@"
        fi
    }



Doesn't help against network filesystems mounted in subdirectories. --one-file-system (which really ought to be the default) prevents this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: