
September 11th, 2003, 01:53 PM
|
|
Junior Member
|
|
Join Date: Aug 2003
Posts: 27
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
find and remove
Hi,
Want to cycle through each single in a directory, remove all lines not containing |, write the ouput in a new and overwrite the old file with the new one.
I have this code:
Code:
files=`find . -print | sort`
for myfile in $files; do
grep '|' $myfile > $OutFILE
mv -f $OutFILE $myfile
done
but I am getting the following problems:
1.) Displays the content of the file --> I don't want that
2.) does nothing else
Could someone please give an idea?
Cheers,
monaL
|