Quote:
Originally Posted by aldomenico
Try this:
while read string
do
# the next line searches and deletes lines that have the string
sed "/${string}/d" destination.txt > dest.tmp
# the next line moves the temporary edited file
# in place for the next iteration
mv dest.tmp destination.txt
done < source.txt
Assuming source.txt contains a list of strings, one per line
|
thnx buddy,
I ran this script removing the "mv dest.tmp destination.txt"
of it so that the output file will remain as dest.tmp.
But the dest.tmp file is similar as destination.txt and no strings
has been removed from this file.
I tried below solutions as well.. but nothing works.
sol1. grep -vf source.txt destination.txt >> dest.tmp
sol2. sort -o source.txt source.txt
sort -o destination.txt destination.txt
comm -13 source.txt destination.txt >> dest.tmp