4 ms·
Instead of: sed -n "/$label:/{:a;n;p;ba};" I think it's more idiomatic to do: sed -n "/$label:/,$ p" Or even: sed "0,/$label:/,$ d" Which deletes
by sltkr 3y ago
Instead of:
sed -n "/$label:/{:a;n;p;ba};"
I think it's more idiomatic to do:
sed -n "/$label:/,$ p"
Or even:
sed "0,/$label:/,$ d"
Which deletes the label itself, so you don't need the subsequent `grep -v ':$'`, but then you also aren't allowed to put any statements on the same line as the label.