in reply to To get the secondary groups for linux

Yeah, I did this in a cron; in perl. My solution was (roughly, this is cut & paste with edit on the fly):
while( my @F = getgrent() ){ push @groups, [@F] }; endgrent(); @sec_gp = map($_->[2], grep($_->[3] =~ /\b$name\b/,@groups) ) );

--
perl -pe "s/\b;([st])/'\1/mg"