Something went wrong. Try again.
Something went wrong. Try again.
362 B · 32 lines
at main
123456789101112131415161718192021222324252627282930313233#!/bin/bash
set -euf
command_exists() { type "${1}" >/dev/null 2>&1}
is_mac() { [[ $OSTYPE = darwin* ]]}
IFS=''
fs="$@"
if is_mac; then if command_exists trash; then trash -F $fs exit 0 fielse if command_exists gio; then gio trash $fs exit 0 fifi
for f in $fs; do mv "$f" "${HOME}/.trash/$(printf $f | tr '/' '%')"done