These machines have no common sense; they have not yet learned to 'think,' and they do exactly as they are told, no more and no less. This fact is the hardest concept to grasp when one first tries to use a computer.
More understandable in awk. Use a BEGIN case to initialise marker patterns e.g. reB = "^### START ###" and similarly reE. Then fast-forward over the section you want to delete.
awk '{ print; if ($0 ~ reB) while (getline > 0) if ($0 ~ reE) { print; break; }'
I am being sponsored by Syntress! They bought me an amazing dedicated server to run catonmat on. If you're looking web services, I highly recommend the Syntress guys!
Education Sponsors
I am being sponsored by A-Writer! If you ever need help with essay writing, look no further than A-Writer! They will help you with your writing in as quickly as 3 hours!
More understandable in awk. Use a BEGIN case to initialise marker patterns e.g. reB = "^### START ###" and similarly reE. Then fast-forward over the section you want to delete.
awk '{ print; if ($0 ~ reB) while (getline > 0) if ($0 ~ reE) { print; break; }'
Reply To This Comment