Context: grep on result of sed grouping, within a loop
<code>grep -r "blah" x.txt | sed 's/cheese(.*)/xlogs/butter1.log/g' | while read -r line; do
echo $line;
//TODO: grep -r "$1" another_file.txt
done
</code>
<code>grep -r "blah" x.txt | sed 's/cheese(.*)/xlogs/butter1.log/g' | while read -r line; do
echo $line;
//TODO: grep -r "$1" another_file.txt
done
</code>
grep -r "blah" x.txt | sed 's/cheese(.*)/xlogs/butter1.log/g' | while read -r line; do
echo $line;
//TODO: grep -r "$1" another_file.txt
done
above code works, to replace cheese123 with xlogs/butter123.log
I want to use the captured 123 in the grouping, for another grep in another file, in the loop.
How do I do that, thanks in advance.