Hey, I need to know the command for adding secondary groups for a user. The only catch is that I have to assume that they are already members of some secondary groups. And if I use modprpw -G [group], then it erases any secondary groups they were previously in, and adds them only to the groups that I specified.

I need to assume that they are already members of other groups, and I only want to ADD to those groups.

I'm running HPUX 11i v1.

Recommended Answers

All 2 Replies

Do it in three steps. First use grep and (sed, cut, or awk) to retreive the groups that the user already has, then place these groups, along with the new groups, in a comma separated list string, then call usermod -G ${stringvar} ${user}

Thanks, good solution.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.