Originally Posted by rjdelight
I have two files (passwd.txt, group.txt) that I would like to take information out of and put into a new file. I would like to list all the users having a shell “/bin/bash” followed by a space separated list of all the groups each user belongs to. I'm brand new to Linux and just trying to organize some things and learn along the way. I would also like to have the new file in alphabetical order, if that is possible.
I don't think this is that complicated of a task, but since I'm a newb I could use the help. Thanks in advance!
Two awks and a while-loop worked for me, makes a 5 line script.
Read up on "-F" in the context of awk, and on bash's while & read.