I need to compare the back.properties with the prod.properties and highlight only those entries in the back.properties that are missing v/s the prod.properties & those that do not match while ignoring the comments delimiter "#" from both comparing files.
Becoz boot_time=ON is present in the prod.properties and the team "may have" missed mentioning it in the back.properties and hence it too needs to be in the output for us to realize.
So, i need anything extra storage=file , anything missing boot_time=ON , anything different cdr_url=http://myback.col.net:1890/service from the back.properties v/s the prod.properties. I hope you can help me now ??
I tried both the suggestion on my windows unix cygwin but the command does not yield any result.
awk '/^#/ {next} NR==FNR {app_prd[$0]=$0;next} {if ($0 in app_prd) { delete app_prd[$0] } else {print }}; END {for (i in app_prd) print app_prd}' app_prd.properties app_dr.properties
awk '/^#/ {next} FNR==NR {app_prd[$0];next} !($0 in app_prd)' app_prd.properties app_dr.properties
$ uname -a
CYGWIN_NT-6.1-WOW64 IUCLP01858 1.7.29(0.272/5/3) 2014-04-07 13:44 i686 Cygwin
The filenames i am trying to compare are app_prd.properties and app_dr.properties.
While on my unix the command fails with the below output.
$ awk '/^#/ {next} NR==FNR {app_prd[$0]=$0;next} {if ($0 in app_prd) { delete app_prd[$0] } else {print }}; END {for (i in app_prd) print app_prd}' app_prd.properties app_dr.properties
awk: syntax error near line 1
awk: illegal statement near line 1
awk: bailing out near line 1
$ awk '/^#/ {next} FNR==NR {app_prd[$0];next} !($0 in app_prd)' app_prd.properties app_dr.properties
awk: syntax error near line 1
awk: bailing out near line 1
uname -a
SunOS mymac 5.10 Generic_150400-09 sun4v sparc SUNW,SPARC-Enterprise-T5220