[Solved] Grep text between patterns using bash [closed]
Sed can do it as follows: sed -n ‘/^======/{:a;N;/\n——/!ba;/score +/p}’ infile ====== Ann Smith score + —— where -n prevents printing, and /^======/ { # If the pattern space starts with “======” :a # Label to branch to N # Append next line to pattern space /\n——/!ba # If we don’t match “——“, branch to … Read more