I am new to Unix Shell scripting. I need to write a shell script for comparing 2 sql output files (basically in .txt format) which are the outputs of the same sql query (before and after a maintenance task like cloning) and print the differences into another text file.
Output file 1 (before clone):
NAME OPEN_MODE
--------- ----------
PROD123 READ WRITE
Output file 2 (after clone):
NAME OPEN_MODE
--------- ----------
DEV123 READ WRITE
We need to compare the above two output files and print the difference into another text file based on the differences. For example:
Here in the above output, The "NAME" column value doesn't match. So the difference should be printed into another file as:
NAME is not matching. OPEN_MODE is matching. Please check.
And the output file will be having multiple such outputs. So, we also need to check all those outputs and spool the difference to another file. Any sample shell script to achieve the same would be helpful.
Regards, AR