Suppose I have content in /etc/shadow file like this:
root:!!:16087::::::
ftp:!!:14796::::::
and in /etc/passwd file like this:
ftp:x:40:49:FTP account:/srv/ftp:/sbin/nologin
root:x:0:0:root:/root:/bin/bash
I want to group them like:
ftp:!!:14796::::::x:40:49:FTP account:/srv/ftp:/sbin/nologin
root:!!:16087:::::::x:0:0:root:/root:/bin/bash
What I did above:
I have first find the command user name from both the file and then concatenating them into single line. Also, I am deleting user name from second line (As this is already present in starting so its not needed 2 times).
What will be the simple command?