#!/bin/bash # maketrash: Create trash directory set in $trash; This is where 'trashed' files were move to. # Version 0.3 build 0802 # by Heiko Barth if [ "$trash" = "" ]; then echo "Error: \$trash variable not set" >&2 exit 1 fi mkdir -p -m 700 "$trash" if [ ! -f "$trash"/empty ]; then script=$(readlink -f "$0") echo '#!/bin/bash' > "$trash"/empty && echo 'rm -rf "'"$trash"'"' >> "$trash"/empty && echo "$script" >> "$trash"/empty && chmod 700 "$trash"/empty fi