![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Adding Multiple Lines to Multiple Files | dayinthelife | Shell Programming and Scripting | 2 | 06-04-2008 11:50 AM |
| retrieved multiple lines on multiple places in a file | dala | Shell Programming and Scripting | 8 | 03-14-2008 03:28 PM |
| Multiple search in multiple files | maxvirrozeito | Shell Programming and Scripting | 2 | 12-13-2007 01:32 PM |
| Please Help. Need Help searching for multiple stings in a file and removing them. | mjs3221 | UNIX for Advanced & Expert Users | 2 | 08-19-2006 06:28 AM |
| Searching for multiple criteria in log files? | Relykk | Shell Programming and Scripting | 4 | 04-20-2004 02:02 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
I am using a DEC ALPHA running Digital UNIX (formly DEC OSF/1) and ksh. I have a directory with hundreds of files that only share the extension .rpt. I would like to search that directory based on serial number and operation number and only files that meet both requirements to be printed out. I am new to scripting and have been try to do this with grep but have not had much luck.
here is a sample of the file: (120205462.rpt) _________________________________ S/N: 10001 Name: ESSM GS Acceptance Operation: 300 ----------------------------------------------------- |
|
||||
|
I short handed the last bit of code because :
ser="S/N: 10001" oper="Operation: 300" I did this because there are chances of having 300 and 10001 in the collected data. using this and the egrep statement I get several operation 190's that have the serial number of 10001. |
|
|||||
|
Quote:
|
|
||||
|
Using the above suggestion gives me an error.
grep: egrep -l "$ser" *.rpt: cannot open [No such file or directory] anymore ideas. Thanks Perderabo |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|