in reply to Filehandles - opening/closing a filehandle

This isn't a response to help you figure out what's going on with your script since I think the previous answers have taken care of that. I just wanted to give you some advice on the questions that you post. It would be to your benifit to try to structure them a little better. For one, you haven't told anyone what happens when you run this. There's actually no question.

If you'd provide output, or an error, or what's happening that's unexpected, I think people would be more willing to help. I'd also suggest reading this thread. It has a lot of really good information on how to post good questions.

I think you'll find that the people here are some of the most helpful you'll find anywhere, but only if you post appropriately. A little more thought to your questions will go a long way.

Good luck with the program...
Rich
bash: undo: command not found