After detecting 'trash-put', I would prefer to use it instead of 'rm' in most cases. If I'm just an alias that can make me feel too confident on machines without my configuration files, so I came up with the following (in my .zshrc):
function rm() {
local go_ahead
read -q "go_ahead?Are you sure you don't want to use rms? (y/n)"
echo ""
if [[ "$go_ahead" == "y" ]]; then
/bin/rm $*
fi
}
alias rms='trash-put'
This seems to work, but I don't have much experience with zsh scripts ... is this a good way to do what I want?
Thanks Peter
source
share