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 > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Question on Regular Expression Katkota UNIX for Dummies Questions & Answers 14 05-18-2008 05:11 PM
Regular Expression question Katkota UNIX for Dummies Questions & Answers 6 05-14-2008 03:23 PM
question (regular expression related) metalwarrior UNIX for Dummies Questions & Answers 1 02-03-2008 11:51 PM
Regular expression question umen Shell Programming and Scripting 7 11-21-2007 09:45 PM
question about regular expression brentdeback Shell Programming and Scripting 0 11-14-2005 04:04 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-19-2006
Krispy Krispy is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 9
Regular Expression Question

Hi - I am trying to ignore the following items from a list.

lp0
lp11
lp12
lp14

The following code works fine, but I was wondering if there was a tidier way to write the lp[0 |11|12|14] regular expression?

Code:
egrep -v "lp[0 |11|12|14]"
Thanks in advance.
  #2 (permalink)  
Old 01-19-2006
linuxpenguin's Avatar
linuxpenguin linuxpenguin is offline Forum Advisor  
Registered User
  
 

Join Date: May 2002
Location: India
Posts: 295
hmm, dunno why you would think the above is not tidy.
but here is another version you may want to use

grep -v "lp[01][ 124]" filename
  #3 (permalink)  
Old 01-20-2006
Krispy Krispy is offline
Registered User
  
 

Join Date: Dec 2005
Posts: 9
Thanks linuxpenguin.

Maybe I am being a bit picky.
  #4 (permalink)  
Old 01-20-2006
aigles's Avatar
aigles aigles is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,414
Quote:
hmm, dunno why you would think the above is not tidy.
but here is another version you may want to use

grep -v "lp[01][ 124]" filename
This command ignore all that lines :
lp0
lp01
lp02
lp04
lp1
lp11
lp12
lp14
Sponsored Links
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:04 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