{"id":6770,"date":"2015-06-19T08:23:24","date_gmt":"2015-06-19T15:23:24","guid":{"rendered":"http:\/\/blog.networkpresence.co\/?p=6770"},"modified":"2015-06-19T08:24:01","modified_gmt":"2015-06-19T15:24:01","slug":"use-sed-to-delete-lines-between-text-phrases","status":"publish","type":"post","link":"http:\/\/blog.networkpresence.co\/?p=6770","title":{"rendered":"Use sed to delete lines between text phrases"},"content":{"rendered":"<p>How to remove lines from stdin between and including the 2 lines as fields in a sed expression:<\/p>\n<p><code>sed \"\/textline1\/,\/textline2\/d\"<\/code><\/p>\n<p>This will delete from the input all lines between a line containing the text &#8216;textline1&#8217; and &#8216;textline2&#8217;.<\/p>\n<p>If you have a \/ char in either textline entry then you should replace it with the two characters inside the quotes of: &#8216;\\\/&#8217;<br \/>\nBeing &#8220;backslash forwardslash&#8221; <- with no space between the characters.\n\nFYI,\nRichard.\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to remove lines from stdin between and including the 2 lines as fields in a sed expression: sed &#8220;\/textline1\/,\/textline2\/d&#8221; This will delete from the input all lines between a line containing the text &#8216;textline1&#8217; and &#8216;textline2&#8217;. If you have &hellip; <a href=\"http:\/\/blog.networkpresence.co\/?p=6770\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70],"tags":[51,78],"class_list":["post-6770","post","type-post","status-publish","format-standard","hentry","category-sales","tag-bash","tag-sysadmin"],"_links":{"self":[{"href":"http:\/\/blog.networkpresence.co\/index.php?rest_route=\/wp\/v2\/posts\/6770","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.networkpresence.co\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.networkpresence.co\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.networkpresence.co\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.networkpresence.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6770"}],"version-history":[{"count":8,"href":"http:\/\/blog.networkpresence.co\/index.php?rest_route=\/wp\/v2\/posts\/6770\/revisions"}],"predecessor-version":[{"id":6778,"href":"http:\/\/blog.networkpresence.co\/index.php?rest_route=\/wp\/v2\/posts\/6770\/revisions\/6778"}],"wp:attachment":[{"href":"http:\/\/blog.networkpresence.co\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.networkpresence.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6770"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.networkpresence.co\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}