Displays the list of groups for a login using command-line in iMac

0

1

How to display the list of groups for which login, contained in the environment variable FT_USER, is a member (separated by commas without spaces) using Unix command line in iMac.

Example:

forFT_USER=nours,the result is"god,root,admin,master,nours,bocal"(with-
out quotation marks)

This is how it should be like

 $>./print_groups.sh 
 god,root,admin,master,nours,bocal$>

Mveliso

Posted 2018-02-13T20:48:09.587

Reputation: 1

Answers

0

groups $FT_USER | tr ' ' ','

Both groups and tr are common unix utils.

Tomas Varga

Posted 2018-02-13T20:48:09.587

Reputation: 101