You can for example do:
while read line
do
grep -q "<inc>true</inc>" ${line}_man.lst && echo $line >> Two.lst
done < One.lst
- The
while read
keeps reading the file names fromOne.lst
and stores them in$line
. grep -q
checks the existence of<inc>true</inc>
in${line}_man.lst
. In case of match, it prints the file name ($line
) intoTwo.lst
.