The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
help me to answer this lo-lp-kl Shell Programming and Scripting 0 05-25-2008 11:45 PM
Answer them if u can... dreambig UNIX for Dummies Questions & Answers 5 12-07-2007 11:14 AM
quick answer DarkestEvil UNIX for Dummies Questions & Answers 9 10-30-2007 06:42 PM
Can anybody answer this..... shivamasam SUN Solaris 3 07-06-2007 02:50 AM
can any one answer ???? mobile01 High Level Programming 2 11-30-2006 12:32 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-28-2007
LaLonde LaLonde is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 4
Is sed the answer?

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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0