I am trying to use bash regex match to parse a line out of a multi-line string. Why does the following not work?
if [[ $qout =~ ${q}[^\n]* ]] ; then
It matches up to the letter n. I tried using \\n or even \\\n, but nothing worked.
$qout contains:
unrouted 0 0 running
dead-letter 0 0 running
$q contains unrouted.
${BASH_REMATCH[0] evaluates to:
unrouted 0 0 ru
What am I doing wrong?