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.

There are couple of Oracle init.ora files one from current prod, the other was setup by vendor in PreProd. We should be able to run a script that compares the 2 and produce a corrected output, plus a report listing the changes made. These are init files in 2 different versions of Oracle. The compare script would have to read a control file that tells it whether it can sort the 2 inputs or not - some config files for certain technologies may get messed up if you sort them, hence the use of a control file to guide the script by specific technology.

I am also working from my end.I shall be thankful to all for your suggestions.Your suggetions are always welcome.

I hope Oracle is well coded enough not to be disturbed by the order in which parameters appear in the initSID.ora !

Thanks for the response. But here i will tell you the scenario.Here we are asking our vendor to setup the configuration as per our specifications.But what happened was previously there is a mismatch in the setup configured by vendor and our setup file.There the problem came.So, My FO asked me to write a script that compare the two files and list the differences in a separate file.Hope you understand it.If any clarification is required please fell free to post the reply.....

Use the diff command

grep -vE "^$|^#" initPRD.ora | sort >initPRD.ora.s
grep -vE "^$|^#" initPRE.ora | sort >initPRE.ora.s
diff initPRD.ora.s initPRE.ora.s

or
Display line only in PRD :

comm -23 initPRD.ora.s initPRE.ora.s 

Display line only in PRE :

comm -13 initPRD.ora.s initPRE.ora.s 

Display only lines that are in both :

comm -12 initPRD.ora.s initPRE.ora.s

Thank you very much.:slight_smile: