Another way:
$ awk -F= '!a[$1]++' first.properties second.properties
The input to this awk is the content of first file followed by second file.
!a[$1]++
prints only the first occurence of a particular key, hence removing duplicates apparing in the 2nd file.from : https://stackoverflow.com/questions/14017577/merge-two-properties-file-using-shell-scripts
No comments:
Post a Comment