#!/bin/sh

if [ "$1" = '-rf' -o "$1" = '-r' ]; then
   shift;
   recursive=true;
fi;

while [ "$1" ] ; do
   # If not recursive, skip directories
   if [ -d "$1" -a ! "$recursive" ]; then 
      echo $0: $1: is a directory; shift; continue; 
   fi;

   [ ! -d ~/.Trash/"`pwd`" ] && mkdir -p ~/.Trash/"`pwd`";
   mv "$1" ~/.Trash/"`pwd`";
   shift;
done;
