Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

want to create a recycle bin

Status
Not open for further replies.

nichess

Programmer
Aug 6, 2001
1
DE
but this script won't work, it is telling me, that I have to many arguments

file_to_remove=$*
dirIn=`pwd`

if [ \(-f $HOME/deleted/.rm.cfg \) ]
then
deleted_dir = `cat $HOME/.rm.cfg`

for i in $file_to_remove
do
if [! \(-f $HOME/deleted/$i -a -w $HOME/deleted/$i \)]
then

mv $dirIn/$i $HOME/delete
else
rm $dirIn/$i
fi
done
else
echo "moved to recycle bin"

Thanks for helping me
 
Nichess,
You dont have a final 'fi' to match your initial if statement; also you need a space character after the '[' character and before the ']' character
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top