Merge two properties file using shell scripts
bash, shell, unix
Solution
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.
Problem
How to merge two properties file, using shell scripts for example : - if i have two properties file like ``` first.properties /test/file="anish" /test/version=3.0 second.properties /test/author=nath /test/version=2.0 ``` if i merge first.properties over second.properties then common existing property should taken from the first.properties so my output should look like ``` final.properties /test/file="anish" /test/version=3.0 /test/author=nath ```