Running two scripts and then compare match or unmatch


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Running two scripts and then compare match or unmatch
# 1  
Old 06-03-2013
Running two scripts and then compare match or unmatch

Hello !
I need to run two diff script to two different remote server and then compare flies from server3.

script1 - server 1 - /xxx/xxx/dir
scrpt 2 - server 2 /xxx/xxx/dir


script1 already will generate script1.output1 and
script2 also will generate script2.output2

Compare:



look for "NEVER" and "xx1234" in script1.output1 ( same row) (xx - any two char, 1234 = 4 digit number)
and look for "NEVER" and "xx1234" script2.output2 (same row) ( same row) (xx - any two char, 1234 = 4 digit number)


generate match file and unmatch file.

Smilie

Thank you.

OS - AIX

---------- Post updated at 04:41 PM ---------- Previous update was at 02:45 PM ----------

I can ssh to those servers via sudo su - command
# 2  
Old 06-04-2013
Quote:
Originally Posted by amir07
Hello !
I need to run two diff script to two different remote server and then compare flies from server3.
script1 will generate script1.output1 on server1
script2 will generate script2.output2 on server2

Compare:
look for "NEVER" and "xx1234" in script1.output1 ( same row) (xx - any two char, 1234 = 4 digit number)
and look for "NEVER" and "xx1234" script2.output2 (same row) ( same row) (xx - any two char, 1234 = 4 digit number)
generate match file and unmatch file.
You could get the files from server1 and server2 back to server3 via scp or sftp, etc. and use diff to generate the matching file and the unmatched file
# 3  
Old 06-05-2013
What i am trying to create a script so that all can be done in 1 shot:

something like this:
Code:
for h in Server1 Server2
(execute script:
script1 - server 1 - /xxx/xxx/dir
scrpt 2 - server 2 /xxx/xxx/dir
)


do
  ssh $h grep "NEVER" ,  =$h '  ( here I am looking for also "two char + 4 digit" same row eg "bc1234" )
BEGIN { print "NEVER UID" }

END {print h,m,s}'
COMM -12  script1.output1  script2.output2 
done


Last edited by vbe; 06-05-2013 at 12:56 PM.. Reason: code tags please
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sdiff doesn't try and compare to closest match

In the example below i would want the extensions to match. Is there any other utility or script to achieve this. Kindly help. Example: sdiff sourceFileNames targetFileNames 17021701P.blf | 17021901P.ibk 17021701P.chn | 17021901P.irk 17021701P.bmr | 17021901P.dyd 17021701P.dpf |... (7 Replies)
Discussion started by: jamilpasha
7 Replies

2. UNIX for Dummies Questions & Answers

Compare data - Match first column and compare second

Hi guys, looking for some help with a way to compare data in two files but with some conditions. example, File 1 consists of site1,10.1.1.1 site2,20.2.2.2 site3,30.3.3.3 File 2 contains site1,l0.1.1.1 site2,50.1.1.1 site3,30.3.3.3 site4,40.1.1.1 I want to be able to match the... (1 Reply)
Discussion started by: mutley2202
1 Replies

3. Shell Programming and Scripting

To take unmatch field in first column

Im uising the below command to take the matching pattern on 1st filed awk 'NR==FNR{_;next}$4 in _' file1 file2 file1 12 sam kash 232 f10 kash 22 data kas file2 56 789 232 Needed output: 12 22 (1 Reply)
Discussion started by: Roozo
1 Replies

4. Shell Programming and Scripting

Compare the Permissions for all the scripts that exists in two Directories

Hello All, I am in the process of finding the permissions on all the files that exists in two directories: Dir1: PROD_Scripts/* Dir2: STAGE_Scripts/* Both the Directories have some shell and perl scripts respectively. Step1: Finding all the Scripts that exists in PROD but Not in STAGE.... (2 Replies)
Discussion started by: filter
2 Replies

5. Shell Programming and Scripting

How to match floating number range in shell scripts?

for example: # I want to judge the value of $1 which should be $2<$1<$3. temp0=`echo "$1 - $2" | bc` temp1=`echo "$1 - $3" | bc` if ] ; then echo OK else echo False fi Please use code tags, thanks. (6 Replies)
Discussion started by: 915086731
6 Replies

6. Shell Programming and Scripting

Match strings in two files and compare columns of both

Good Morning, I was wondering if anybody could tell me how to achieve the following, preferably with a little commenting for understanding. I have 2 files, each with multiple rows with multiple columns. I need to find each row where the value in column 1 of file 1 matches column 1... (10 Replies)
Discussion started by: GarciasMuffin
10 Replies

7. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

8. Shell Programming and Scripting

Running scripts via su

Hi All, Am using the below command to start my application using the root user su - bin -c "/home/bin/test/start.sh" but am getting the error becaue i have set some environment varibales in bin .profile when i execute the command start.sh by logging directly into bin account it's... (8 Replies)
Discussion started by: ravi.sri24
8 Replies

9. Shell Programming and Scripting

compare/match arrays

Hi there all, I am having a question. Is it posible to compare elements of 2 different arrays? For example I got Array 1 | Array 2 123_abc | 123_bcd 123_bcd | 234_bcd 234_abc | 567_abc 234_bcd | 123_abc than the match is 123_abc & 234_bcd and non of the others. So... (3 Replies)
Discussion started by: draco
3 Replies

10. Shell Programming and Scripting

Compare two files UNMATCH in solaris

I have these following code, which give me output of a match items. Can any please help me to reverse the code so that I can get UNMATCH items: #! /usr/bin/bash cut -d":" -f1 file261 | sort >file261a tr "\t" " " <file262 | cut -d" " -f2 | sort >file262a comm -12 file261a file262a ... (8 Replies)
Discussion started by: amir07
8 Replies
Login or Register to Ask a Question