#!/bin/sh # # can file # can file1 file2 # can file* # # will move files to the .trashcan. # # First, create $HOME/.trashcan if it doesn't exist: if [ -d $HOME/.trashcan ] ; then : else echo Creating $HOME/.trashcan mkdir $HOME/.trashcan # create a trashcan if needed chmod u=rwx $HOME/.trashcan # protection so only user can read chmod "go=" $HOME/.trashcan # to hinder garbologists fi # The following works to preserve a single filename with spaces # mv "$*" $HOME/.trashcan # The following is needed for multiple files separated by spaces mv $* $HOME/.trashcan exit