I have two files in style of /etc/group :
root:x:0: daemon:x:1: bin:x:2: sys:x:3: adm:x:4:username tty:x:5: disk:x:6: lp:x:7: mail:x:8: news:x:9: ubuntu:x:999:
And I want to merge them into a third file, but no GID should occur twice in the merged file.
How could this be done using bash command? I was thinking that it could be done with
awk, but I cannot find a solution at the moment.
EDIT I need to keep the original GID from each file there could be two groups with same name, but not with same GID. in the output file the GID should be unique `