1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-07-03 17:00:27 +00:00
prezto/plugins/osx/functions/trash
2012-01-23 20:40:57 -05:00

14 lines
349 B
Plaintext

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