This repository has been archived on 2022-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
prezto/plugins/osx/functions/trash

14 lines
349 B
Plaintext
Raw Normal View History

2011-10-11 23:13:58 -04:00
local trash_dir="${HOME}/.Trash"
local trash_item
local item
for item in "${@}"; do
if [[ -e "${item}" ]] || [[ -L "${item}" ]]; then
trash_item="${trash_dir}/${item:t}"
if [[ -e "${trash_item}" ]] || [[ -L "${trash_item}" ]]; then
trash_item="${trash_item} $(date "+%H-%M-%S")"
fi
mv -f "${item}" "${trash_item}"
fi
done