[HPADM] RE: [-SUMMARY]-Grep for multiple patterns in a file

From: Naylor, Jim (Jnaylor@Schnucks.com)
Date: Wed Nov 23 2005 - 16:56:20 EST


Thanks to Todd Willeat, Steve Illgen, Marc Ahrendt, Shyam Hazari, Steffen Jaiser, Richard Wright, Jeff Kell, Angel Saldarriaga, Kenneth Ray, Mames Perry, and Mike Keighley for their responses. As I anticipated, this was something stupid I had done. All suggested one form or the other of these two commands:

grep -E 'OSS 064|OSS 74' filename
or
grep -e "OSS 064" -e "OSS 75" filename

Of course I tried them all and it still did not work. I found that on my second pattern I had typed a zero instead of a capital O. I was using the ksh to do an escape k instead of re-typing the command. Please forgive me for such a stupid mistake and wasting your time. This list is the best.

Thanks,
Jim Naylor
Unix/Storage Systems Administrator
Schnuck Markets, Inc.
* Direct (314) 994-4784
))( Cell (314) 691-0186
      Fax (314) 994-4684
* E-Mail jnaylor@schnucks.com

-----Original Message-----
From: hpux-admin-owner@DutchWorks.nl
[mailto:hpux-admin-owner@DutchWorks.nl]On Behalf Of Naylor, Jim
Sent: Wednesday, November 23, 2005 2:39 PM
To: Hpux-Admin@Dutchworks. Nl (E-mail)
Subject: [HPADM] Grep for multiple patterns in a file

Hello All,
I seem to be having a brain block. I need to grep two different patters within a file.

First Pattern = "OSS 064"
Second Pattern = "OSS 75"

Note the spaces after the OSS. I though grep -e pattern1 -e pattern2 filename would work but it doesn't. Any help would be appreciated.

Thanks,
Jim Naylor
Unix/Storage Systems Administrator
Schnuck Markets, Inc.
* Direct (314) 994-4784
))( Cell (314) 691-0186
      Fax (314) 994-4684
* E-Mail jnaylor@schnucks.com

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)
--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:50 EDT