What do you want. remove file2 from filenames or from the output of the grep command ? If you want to remove file2 from the output of grep command then use 'sed'
PS - i have limited access to internet so may not be able to answer very promptly.
Ok, maybe I should describe what I want to do more clearly.
On a windows server where we ftp files to, we have unix scripts that move files to certain directories on the windows server that begin with "data2/". That has changed, they are removing "data2/" from the path, not to mention different servers but thats not my question.
I have about 30 production unix scripts to modify in a certain unix directory that contain "data2/" instances. I cant rename the scripts, I basically have to remove the "data2"/ from each one. Is there a command I can run from the prompt, or do I have to do each one with VI. Either way you guys advise to be easier, how do you do it? :o