Hey, I am very new to scripting and could use a bit of help.
I have a situation where I have an ascii file and I want to delete all lines beneath a particular string.
EXAMPLE:
The contents of a file named example.txt looks like the following:
JANUARY
FEBRUARY
MARCH
APRIL
MAY
JUNE
JULY
AUGUST
SEPTEMBER
OCTOBER
NOVEMBER
DECEMBER
Now I want to be able to run a command where it will delete all lines in the example.txt file beneath the "JUNE" line. I assume that this is pretty easy to do, but given my lack of experience I am having trouble figuring this out.
Is sed the answer? If so, what would the exact command be given my example?
The system I will run the command on is a Solaris 10 base install system with no 3rd-party packages installed.
Thank you in advance!
- LaLonde