ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have a line of code in using sed that extracts the frist instance of a word and extracts the entire segment of code associated with that word and writes it to a file. I don't want to extract the lines I want to delet them what am I missing? Here's what I have so far:
sed -e '/./{H;$!d;}' -e "x;/REGEX/!d;" FILENAME > OUT.TMP
Ideally I'd like to redirect the output to OUT.TMP while deleting it from FILNAME all together.
The output in OUT.TMP would look like this
this is REGEX and stuff
I'm apart of the REGEX paragraph
this is the last line that will be read because the next line is blank
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.