LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-23-2006, 04:39 AM   #1
sharad
Member
 
Registered: Dec 2005
Posts: 48

Rep: Reputation: 15
how to find a pattern using shell script


Hi,

I want to find and delete a pattern like
Connection <some string> = {

here "some string" may be any string and rest of the pattern is same.
So how can I accomplish this.Please help me to do the same.
 
Old 05-23-2006, 04:50 AM   #2
dubz_444
Member
 
Registered: Mar 2006
Location: South Africa
Distribution: Arch Linux
Posts: 43

Rep: Reputation: 15
a string in a file i suppose?


well then there are programs like sed and grep

eg. cat infile | sed '1,6d'- delete lines 1,6
cat infile | sed 's/bob/greg/g' -replaces all instances of "bob" with "greg"

man sed for more...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Script to Delete line if pattern exists topcat Programming 22 08-23-2011 05:58 AM
Shell script to find a particular string Prasun1 Linux - General 5 08-30-2005 10:23 AM
find shell script help liren Linux - Newbie 3 05-02-2005 04:05 PM
Procmail: match pattern then pass to shell script essdeeay Linux - Software 1 11-08-2004 03:19 PM
how to find the pid of a perl script from shell script toovato Linux - General 1 12-19-2003 07:25 PM


All times are GMT -5. The time now is 09:00 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration