On Thu, 12 Jun 2003 20:25:00 +1000
Keppy <[EMAIL PROTECTED]> wrote:
> # usermod -G newgroup,group1,group2,... username
> 
> will add "newgroup" to the list of groups that user belongs to. Make 
> sure to include all the present groups though.

Shortcut for adding a group: 
usermod -G newgroup,`groups username|sed "s:\ :,:g"` username

For removing:
usermod -G newgroup,`groups username|sed "s:\ :,:g"|sed "s:groupname,:"`
username

Simple enough to make scripts called e.g. 'groupadd' and 'groupdel' so
modifying groups becomes a lot easier (or just modify/etc/group...)

Einar

--
[EMAIL PROTECTED] mailing list

Reply via email to