I want to loop through thousands of folders all which contain a file called output(foldernumber).txt
and check which of these output files DO NOT contain a keyword and have the script write out a list of these output files, so further analysis can be completed on them.
This is what I have so far:
a=1
b=1
for i in ~pwd ;do
(cd $i/ && grep -L 'keyword' output"$a".txt >> ../list.txt)
a=$((a+b))
done
Errors given say the output files do not exist and a blank list.txt
file is made. Any advice please?