How to delete multiple lines after a match?

822 views
Skip to first unread message

Weiwen Chen

unread,
Feb 26, 2016, 3:31:37 PM2/26/16
to Ansible Project
Hello Expert,

Is there a way in ansible to delete multiple lines after a pattern matched?


For example, I have a file with following contents, and need to delete lines 'bbbbbb', 'cccccc'. However I really do not know what are those two lines as they are generated dynamically. I only know line 'aaaa:'

-----------------------
start contents
aaaa:
    bbbbbb
    cccccc
other contents

Weiwen Chen

unread,
Mar 2, 2016, 12:11:02 PM3/2/16
to Ansible Project
I end up with replace module with pattern 'aaaa:' in it.
Reply all
Reply to author
Forward
0 new messages