So using a combination of sort/cut/grep/awk/join/paste/sed I need to create a txt file where the output would be placed and looks like the following based on user is the passwd file having :"bin/bash" on their column. The new file will have the users and groups both in alphabetical order. It should look something like this apparently.
Groups: course prof test
Groups: course othercourse student
If anyone can help me please it would be greatly appreciated.