compare 2 outputs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting compare 2 outputs
# 1  
Old 05-21-2008
compare 2 outputs

Hello,
I have a shell script that is used as follows:

./script -s <Oracle_server_name>

the script returns several lines in this format:
parameter name required value Current Value comments
--------------- ------------- -------------- ---------

My objective now is to compare 2 oracle servers. I want for example to see the current value that differs between the 2 servers.


1] What should I do so that the script connects to the second server after it finishes with the first Oracle server? Currently the script has one argument.

2] Any hints on how to display the unmatched current value of both servers?

thx
# 2  
Old 05-21-2008
Quote:
Originally Posted by melanie_pfefer
What should I do so that the script connects to the second server after it finishes with the first Oracle server? Currently the script has one argument.
Loop over it like 'for SERVER in Oracle_server_name Oracle_server_name; do script -s "$SERVER"; done'?


Quote:
Originally Posted by melanie_pfefer
Any hints on how to display the unmatched current value of both servers?
"Simple" solution could be to pipe output from each query to a temporary file and run 'diff' on it, qualitatively "better" solutions may depend on the format of the output (fixed items per line, fixed amount of lines?) and what you need to check (integer, word, relationship between items, etc, etc). Maybe post some lines you would like to compare.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Printing awk outputs

Hello All, I have the following command which works partially: gzcat *2016-03-25_*gz | gawk -F"|" ' BEGIN{format = "%-10s %-13s %-17s %-35s\n"; printf format, "EVENT_TYPE","RESPONSE_CODE","INTERNAL_ERR_CODE","FLOWNAME"; printf format, "----------", "-------------", "-----------------",... (6 Replies)
Discussion started by: EAGL€
6 Replies

2. Shell Programming and Scripting

Compare two files, then outputs line number

I have two files, "ranked.txt" and "sorted.txt". Sorted.txt is a smaller subset from ranked.txt that is sorted in alpha order. However ranked.txt preserves the ranking of words I would like to keep. How do I check the rank of every word in sorted.txt when matched to the original ranked.txt? I... (8 Replies)
Discussion started by: pxalpine
8 Replies

3. UNIX for Dummies Questions & Answers

gunzip outputs gibberish

I run cygwin on windows 7, and have been using the windows command line. I've been trying to gunzip some previously compressed large sequence output files in .txt.gz format. This worked for about the first 10 files and then for the rest of them the file (as viewed using the 'head' command) is... (1 Reply)
Discussion started by: woceht
1 Replies

4. UNIX for Dummies Questions & Answers

AWK - Different outputs *Question*

I'm having a small issue with AWK: I run this in PUTTY: awk 'BEGIN{FS=","}NR==FNR{A=$1;next}{if (A==$1) print $0}' FILE1 FILE2 And it gives me the output that I expect. I wanted to create a file.awk file that i could just run instead of typing this out all the time. But its not giving my... (1 Reply)
Discussion started by: WongSifu
1 Replies

5. Shell Programming and Scripting

Compare two outputs/files based on criterias

Hello, I currently have a script that outputs to a file that contains the output below. It runs every X minutes. I would like to compare the first run against the second but only output if the minutes column is less than its original or if anything else changes. Thanks for the help. Original ... (2 Replies)
Discussion started by: tworkemon
2 Replies

6. Shell Programming and Scripting

Shell script that will compare two config files and produce 2 outputs 1)actual config file 2)report

Hi I am new to shell scripting. There is a requirement to write a shell script to meet follwing needs.Prompt reply shall be highly appreciated. script that will compare two config files and produce 2 outputs - actual config file and a report indicating changes made. OS :Susi linux ver 10.3. ... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

7. Shell Programming and Scripting

create outputs from other command outputs

hi friends, The code: i=1 while do filename=`/usr/bin/ls -l| awk '{ print $9}'` echo $filename>>summary.csv #Gives the name of the file stored at column 9 count=`wc -l $filename | awk '{print $1}'` echo $count>>summary.csv #Gives just the count of lines of file "filename" i=`expr... (1 Reply)
Discussion started by: rajsharma
1 Replies

8. UNIX for Dummies Questions & Answers

Multiple Substring Outputs

Hello, I am reading a file with millions of lines in it. Each line is big line containing several xml tags. I need to Output just the value of two tags in a seperate flat file. For eg- I need to output whats present in <ComponentName> something </ComponentName> and another tag is... (2 Replies)
Discussion started by: sunnybehl
2 Replies

9. Shell Programming and Scripting

Printing outputs using awk.

I have a output of a command like this. the command is : bdf|sed '/^e/d'|awk '{print$2/1048576}' output : 0 0.515625 0.481979 2 2 2 7.8125 4 2 0.488281 7.8125 3.90625 4 1.95312 1 0.488281 (4 Replies)
Discussion started by: Krrishv
4 Replies

10. Solaris

I may have accidentally redefined one of the outputs...

I get unexpected results when doing ls -al | more and ls -al | grep. When I do not pipe the output, it comes to the screen just fine, and there is output! When I pipe to another command, I either get nothing, or else I get a strange dump. Which of the outputs have I accidentally affected?... (2 Replies)
Discussion started by: joang
2 Replies
Login or Register to Ask a Question