Group Names

group_names
Arguments:

[$1…] - Arguments to the id command

Output:

stdout - Space delimited list of group names. Spaces in group names have been replaced with _

Uses:

id

Determine all the group names associated with a user

On Linux, there is a relatively simple way to get all the group names, unambiguously, even if the names contain spaces and parentheses. However, on macOS, these same features do not exist without the GNU version of id, which is not available without brew, etc… So this script will get that information for you, one way or another.