mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-20 03:02:29 +01:00
16 lines
344 B
Bash
16 lines
344 B
Bash
function rm () {
|
|
local files
|
|
local trash=~/.Trash/
|
|
for files in "$@"; do
|
|
# ignore any arguments
|
|
if [[ "$files" = -* ]]; then :
|
|
else
|
|
local dst=${files##*/}
|
|
# append the time if necessary
|
|
while [ -e $trash$dst ]; do
|
|
dst=$dst_$(date +%H-%M-%S)
|
|
done
|
|
/bin/mv $files $trash$dst
|
|
fi
|
|
done
|
|
}
|