LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-16-2008, 03:00 PM   #1
squirrel001
Member
 
Registered: Feb 2006
Posts: 51

Rep: Reputation: 15
pattern matching help needed.


I have a file which contains the following:


**********
NSVCI NSVCSTATE BLSTATE BLORIGIN
420 ACT

SIGBVCI CSTATE BLSTATE BLORIGIN SGSNFEAT
0 ACTIVE H'3

BVCI ELL CSTATE BLSTATE BLORIGIN
1025 BAYIG ACTIVE
1024 CRCIG ACTIVE
1023 RUPIG ACTIVE
1022 BAD1A ACTIVE
983 DOH6B ACTIVE
982 DOH6C ACTIVE
981 WHX3C BLOCKED ABL H'400
980 GSN2C ACTIVE
708 BMLIG ACTIVE
704 MDNIG ACTIVE

END
**********

I need to extract the portion of the file that is in between BVCI and END. Also i need to match the 3rd column (below CSTATE) to see whether it contains all BLOCKED state or not. Please guide me to write the script in bash.
 
Old 06-16-2008, 06:51 PM   #2
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
maybe this will help: http://www.linuxquestions.org/questi...arsing-359625/
 
Old 06-17-2008, 06:28 AM   #3
squirrel001
Member
 
Registered: Feb 2006
Posts: 51

Original Poster
Rep: Reputation: 15
Thanks. It works for me. Thanks for your kind response.
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pattern Matching Problem ratul_11 Programming 3 12-28-2007 12:27 AM
pattern matching nadeemr Linux - Newbie 8 06-13-2007 11:05 AM
Sed pattern matching digitalbrutus Programming 1 08-20-2006 01:37 PM
Perl pattern matching in VB rigel_kent Programming 1 05-30-2006 11:00 AM
pattern matching in perl ludeKing Programming 9 04-02-2004 09:53 AM


All times are GMT -5. The time now is 06:22 PM.

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