# del Moves the argument to directory $HOME/trash instead of removing it. # Bumps old version in trash to /tmp/jerry.trashfiles if it exists. # Directory /tmp/jerry.trashfiles is created by .cshrc. # setenv stamp `date | awk '{print $2"_"$3"_"$4}'` echo "Moving files(s) to the trash ..." foreach FILE ($*) if ( ! -f $FILE ) then # if not file or directory (clumsy) if (! -d $FILE ) then echo "$FILE not found" exit endif endif if (-f $HOME/trash/$FILE) then echo " * File $HOME/trash/$FILE exists. " echo " * Bump it to /tmp/jerry.trashfiles/$FILE+$stamp." mv $HOME/trash/$FILE /tmp/jerry.trashfiles/$FILE+$stamp else if ( -d $HOME/trash/$FILE) then echo " * Directory $HOME/trash/$FILE exists. " echo " * Bump it to /tmp/jerry.trashfiles/$FILE+$stamp." cp -r $HOME/trash/$FILE /tmp/jerry.trashfiles/$FILE+$stamp rm -r $HOME/trash/$FILE endif mv $FILE $HOME/trash echo "$FILE moved to $HOME/trash ..." end # # Original del command was more simple: # echo "Moving " $* " to $HOME/trash ..." # mv -i $* $HOME/trash