#!/bin/sh
# rmw-0.95.1
# ReMove to Waste folder
# Author: Andy Alt ( https://sourceforge.net/projects/rmw/ )
# October 31, 2008
# License: GPL
# Description: Linux Console trash/waste basket, bash script to move 
# files with "rm" instead of erasing them
# Use this script at your own risk.
 
# Typically a person is in the directory of the file or directories
# he or she wishes to remove. The path to the present working directory
# is assigned to 'PRESENTDIR' and will be used
# later -- files will be moved into ~/.Waste$PRESENTDIR to ease
# restoration if needed.
#
PRESENTDIR=`pwd -P`
#APPENDSTR=_`date +%F_h%Im%Ms%S%p`
#APPENDSTR=_`date +%F_%Ih%Mm%Ss`
APPENDSTR=.`date +%j%y%I%M%S`

mvargs=$1
shift

	mkdir -vp $HOME/.Waste$PRESENTDIR$APPENDSTR

	for FILE in "$@" ; do
        	mv $mvargs "$FILE" $HOME/.Waste$PRESENTDIR$APPENDSTR
	done
#
# Take off some permissions of newly moved files so they'll not be
# readable, writable, or executable by group or others.
# If you want to preserve permissions (for smoother restoration later,
# if needed) keep the line below commented
# chmod -Rv go-rwX $HOME/.Waste$PRESENTDIR$APPENDSTR

exit 0

# end script
