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
rm core files and pattern matching littleIdiot UNIX for Dummies Questions & Answers 3 10-15-2008 10:45 AM
Matching and combining two files sickboy Shell Programming and Scripting 3 07-17-2008 12:20 PM
shell script for matching 2 files gholdbhurg Shell Programming and Scripting 8 06-23-2008 07:33 AM
Matching and combining two files p3t3r Shell Programming and Scripting 5 05-20-2008 10:16 AM
Find matching lines between 2 files jojojmac5 UNIX for Dummies Questions & Answers 5 01-18-2007 01:06 PM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-21-2008
amir07 amir07 is offline
Registered User
  
 

Join Date: Feb 2007
Posts: 37
Smile compare two files for matching in solaris

I am using solaris, need either awk/shell or perl script to compate two files.
both of these file1 and file2 are located in two diffent location path in the same server.
file1 location: /export/db/mna
file2: /etc/dba

The script will compare in file1 first field (e.g. abc00asp)before colon:
and will look for match in file2 second field (e.g. abc00asp)


File1 format:


abc00asp:11.83.0.1
def01asp:11.83.0.2
efg00asy:11.83.0.5
rkl01atm:11.83.0.6
ppr00rsm:11.83.0.7
trt00nsm:11.83.0.8



File2 Format:

172.25.0.97 abc00asp abc00asp.atl.mnn.net
172.25.0.97 ppr00rsm ppr00rsm.atl.mnn.net
172.25.0.97 bppr00rsm pr00rsm.atl.mnn.net
172.25.0.97 ypr00rsm ppr00rsm.atl.mnn.net
172.25.0.97 ppr00rsm ppr00rsm.atl.mnn.net
172.25.0.97 trt00nsm trt00nsm.atl.mnn.net


The outfile will indicate match files:


abc00asp
ppr00rsm
trt00nsm


Thank you.
 

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 04:00 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