Fedora Linux Support Community & Resources Center
Prev Previous Post   Next Post Next
Old 9th April 2012, 11:49 AM
glennzo Offline
Un-Retired Administrator
Join Date: Mar 2004
Location: In your closet
Posts: 15,550
Remove lines of text using a script

I wonder if anyone can help me and at the same time teach me ... how to remove lines containing selected text from a text file using bash scripting. For example, if a text file contains the following lines, at random locations within the file and not necessarily one following the other:

PHP Code:
glenn the_linuxfan
mike the_linuxfan
john the_linuxfan 
How the h-e double hockey sticks is this accomplished? I've examined sed and awk, loops, arrays, etc. but I just-can't-get-it-right !!!!

Your kind suggestions will be immensely appreciated.
The Bassinator
© ®
Reply With Quote

lines, remove, script, text

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Question] How to remove all lines that contain certain text in VI beyonddc Using Fedora 2 22nd August 2007 04:58 PM
Need a script to remove lines beginning with a certain word Jongi Programming & Packaging 2 8th July 2007 05:07 PM
Script to Remove few lines from a file fed.linuxgossip Using Fedora 3 5th March 2007 10:46 PM
Awk for specific lines in text keysorsoze Using Fedora 1 17th January 2007 09:14 PM

Current GMT-time: 05:38 (Tuesday, 22-08-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat