September 11th, 2003, 01:53 PM
find and remove
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:
but I am getting the following problems:
files=`find . -print | sort`
for myfile in $files; do
grep '|' $myfile > $OutFILE
mv -f $OutFILE $myfile
- 1.) Displays the content of the file --> I don't want that
2.) does nothing else
Could someone please give an idea?
September 11th, 2003, 04:04 PM
LOL This question is crossposted: linux forum and here.
Look at the linux forum, just posted your answer there.