•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,433 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,638 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 735 | Replies: 2
![]() |
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.
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.
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}
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
![]() |
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- HELP: User Log In From Connected in Access Database (C#)
- Accessing Network PC wihout user or comp name problem... (Networking Hardware Configuration)
- Safety Remove not functioning correctly (Techies' Lounge)
- Access Level for User and Admin (Community Introductions)
- nwiz.exe closes when booting (Windows NT / 2000 / XP / 2003)
- looking to remove user access to specific program (Windows NT / 2000 / XP / 2003)
- Issues with pagemaker. (Windows NT / 2000 / XP / 2003)
- Giving records in MS Access unique numbers (MS Access and FileMaker Pro)
- Final Year Project (Networking Hardware Configuration)
Other Threads in the Shell Scripting Forum
- Previous Thread: Greping variables from a file
- Next Thread: korn shell script_for loop



Linear Mode