The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Need a regular expression tony3101 Shell Programming and Scripting 4 06-05-2008 04:13 AM
regular expression and awk nickg UNIX for Dummies Questions & Answers 2 08-16-2007 06:23 PM
regular expression...help!! andy2000 UNIX for Dummies Questions & Answers 6 07-18-2007 06:10 PM
help in regular expression Rakesh Ranjan High Level Programming 5 10-25-2006 02:00 PM
Regular Expression + Aritmetical Expression Z0mby Shell Programming and Scripting 2 05-21-2002 11:59 AM

Closed Thread
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
  #1 (permalink)  
Old 03-19-2008
ag79 ag79 is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 33
regular expression

Hello All!

I have a file thats something like this: ( a grep output)


/path/of/file/filename.abc.xyz.pqr:! Commented text
/path/of/file/filename.abc.xyz: ! More Commented text

I need to grep out those line from this file whose filename has ".abc" in the filename (anywhere in filename) and then a colon (, any amount of space or tab, and then a bang (!) sign.

Something like this

*.abc*: (any amount of space/tab)!*

How do i write a RE for this?

I'm doing grep -E "\.sqr*:[ *]!*" file but it's not giving correct result

Thnx for ur help!
  #2 (permalink)  
Old 03-19-2008
rajut1984 rajut1984 is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 3
Try this :

*.abc*: (any amount of space/tab)!* - patten to be matched


1) /.*\.abc\:\t*\!/s

or

2) /.*\.abc\: *\!/s
  #3 (permalink)  
Old 03-19-2008
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,927
grep -E "\.abc.*:*!" file
  #4 (permalink)  
Old 03-19-2008
ag79 ag79 is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 33
thnx guys, i did some minor mod, this works for me:
grep -v -E "\.abc*:[ \t]*!" file
Closed Thread

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 08:13 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