in reply to Merge the difference between two files and save it on the first file. Also update the first file with info in second file.
As a one-liner: (make sure you keep a copy of file1 around...)
perl -ne "/^([^=]+)/ and $_{$1}=$_; END {print sort values %_}" file1 +file2 > file1 [download]