0

In the /etc/group we have many many users in one group, separated by comma like, jdoe,adoe,cdoes, etc.
I need to make a (one column) list for my report that looks like:

jdoes adoe cdoe ..... 

1 Answer 1

1

Assuming the group is named groupname...

Get the specific line out of the group file:

getent group groupname 

Delete the bit of the result before the last :

getent group groupname | sed 's/.*://' 

Replace the commas with newlines:

getent group groupname | sed 's/.*://' | tr ',' '\n' 
0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.