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

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

sql server - SQL Query returns one result, does not return 0 or NULL result -