where $file contains the filename.
A quick search turned up this answer and I'm sure there are many more. You might want to get into the habit of doing a search for an answer yourself. It will save you loads of time and make you feel better when you find one. I found the solution given above here