This is for my linux class. §The /etc/group file defines the groups to which use
ID: 3792391 • Letter: T
Question
This is for my linux class.
§The /etc/group file defines the groups to which users belong. Its format is as followed:
Group : password : Group ID : Group List
Group List of usernames for users who are members of the group
Password is an encrypted field and will usually show “x”
Group is the name of the group, shown in the group field of ls –l
§Write an awk script, called activity5.3-5.awk, that displays the group name and usernames of group members. Groups without members shall not be displayed. Below is a report format example.
§Also provide the command to run the script
List of Groups and users
Group Name UserID
----------------- ---------
root root
daemon root, bin, daemon
… …
This conclude the listing
Explanation / Answer
I have prepared the awk file which will print text according to your requirement.
AWK script
awk -F':' '{print "Group Name " "User ID" }''{print $3 " " $1 " " $4}' /etc/group
This will resolve all you doubts if you have any queries please leave a comment.
Happy Chegging !
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.