need assistance ----SH schell script

Hello All,

I need to develop a script(SH]) to generate a comparison file between two files old and new file.The script takes in parameter the old file path and the new file path. And the script generates a file containing the comparison between the two files with this details:

  • Keys added on the new file (key=value)
  • Keys modified on the new file (key=value)
  • Keys deleted on the new file (key=value)

key column is the 4th one and value column is the 6th one in the sample file.

Example:

old file: key1,value1 new file:key4,value3
key4,value4 key6,value6

output file: comparison file
------------------

1> keys added ----- key6,value6
2>deleted ---------- key1,value1
3> modified---------- key4,value3

I'm new to schell scripting field. request you to explain briefly along with the code. any sort of assistance would be appreciated.
Thanks in advance

Regards Shahid.:slight_smile:

You could get away with some of this in diff, depending on your actual data. There are a few sexy awk examples on globbing diff results.

I would take the output of diff into perl, but your married to "SH" for some reason whatever that is.

Thanks a lot.:slight_smile: