regex - get all lines NOT end with 'rpms' in sed -
i want append following line lines. if have tips, please let me know. lot.
i have tried
sed -e '/?!(rpms$)/{n;s/\n//}' filename
but failed.
i think looking put lines don't end rpms on single line:
sed -e ':a;/rpms$/!{n;s/\n//;ba}'
instead of trying negate pattern, can negate test putting negation operator !
after pattern.
to handle case there more 2 lines without rpms @ end, added label :a
, unconditional jump ba
label.
Comments
Post a Comment