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
how to find whether a file is local or remote file? jackfds UNIX for Dummies Questions & Answers 3 07-10-2007 08:36 AM
Transfer file from local unix server to remote server indira Shell Programming and Scripting 2 05-03-2007 06:35 AM
Transfer file from local unix server to remote server indira HP-UX 2 05-02-2007 05:15 PM
FTP multiple files from remote server to local server berlin_germany Shell Programming and Scripting 2 12-20-2006 03:24 AM
executing a remote location script from local server srivsn Shell Programming and Scripting 2 02-28-2006 03:16 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 03-07-2008
amir07 amir07 is offline
Registered User
  
 

Join Date: Feb 2007
Posts: 37
Find match in two diff file - local srv and remote server

Perl Guru….

I need to compare two diff file (file1.abc will locate in current server and file2.abc will locate in remote server), basically the script will look for match in both file and only will send out email if there is no match and also give me list of unmatch and dups as well.

So here is the logic how the script will work.

The script will reside in Server1.
Server 1 has 13 different files like:

file1.abc …………..>compare with remote server (server 2) file2.abc
file1.bcd…………..>compare with remote server (server 3) file2.abc
file1.dfg …………..>compare with remote server (server 4) file2.abc
file1.ghi…………..>compare with remote server (server 5) file2.abc
file1.ijk…………..>compare with remote server (server 6) file2.abc
file1.klm…………..>compare with remote server (server 7) file2.abc
file1.mno…………..>compare with remote server (server 8) file2.abc
file1.opq…………..>compare with remote server (server 9) file2.abc
file1.qrs…………..>compare with remote server (server 10) file2.abc
file1.stu…………..>compare with remote server (server 11) file2.abc
file1.uvw …………..>compare with remote server (server 12) file2.abc
file1.wxy…………..>compare with remote server (server 13) file2.abc
file1.yza…………..>compare with remote server (server 14) file2.abc

(The file names before extension are the same in Server1, but all filename are same in remote servers)

Now I need to compare file1.abc with remote server (Server 2) filename (file2.abc) (/xxx/xyx/mns/file2.abc). The script need to compare only with component name
In this example sunsoloaris, hpunix, linux.


All of the file has same format in both file types.
Format is like the following:

file1.abc format:

Fsdfsdf kkldfsd
Component sunsolaris
Sdfsdfs dfdsfds
Sdfsdf sdfsdf
Sdfsdf ertyertre
Sdfsdf hfdghdfgd

Fsdfsdf kkldfsd
Component hpunix
Sdfsdfs dfdsfds
Sdfsdf sdfsdf
Sdfsdf ertyertre
Sdfsdf hfdghdfgd



Fsdfsdf kkldfsd
Component linux
Sdfsdfs dfdsfds
Sdfsdf sdfsdf
Sdfsdf ertyertre
Sdfsdf hfdghdfgd


Following is file2.abc (Remote server – server 2)

Fsdfsdf kkldfsd
Component sunsolaris
Sdfsdfs dfdsfds
Sdfsdf sdfsdf
Sdfsdf ertyertre
Sdfsdf hfdghdfgd

Fsdfsdf kkldfsd
Component winxp
Sdfsdfs dfdsfds
Sdfsdf sdfsdf
Sdfsdf ertyertre
Sdfsdf hfdghdfgd

Fsdfsdf kkldfsd
Component hpunix
Sdfsdfs dfdsfds
Sdfsdf sdfsdf
Sdfsdf ertyertre
Sdfsdf hfdghdfgd

Fsdfsdf kkldfsd
Component winxp
Sdfsdfs dfdsfds
Sdfsdf sdfsdf
Sdfsdf ertyertre
Sdfsdf hfdghdfgd




Output will be in an email:
(If exact match of Component found don’t send email.)
If exact match of Component not found send email. E-mail should indicate:
Component linux not found in file2.abc in remote server (server 2)
Multiple entries of Component winxp found in file2.abc in remote server (server 2)

To get date from remote server login and passwd will be required.


Thanks.
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 06:09 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