Re: remove users from group

Previous thread: Script for the creation of multiple user accounts by OpenBSD Geek on Sunday, December 12, 2010 - 3:30 am. (2 messages)

Next thread: Re: remove users from group by S Mathias on Sunday, December 12, 2010 - 6:36 am. (1 message)
From: OpenBSD Geek
Date: Sunday, December 12, 2010 - 4:44 am

To remove users from example group "users", i usually do it by editing the
file /etc/group, and remove it manually.
Is there a way from command line to remove some users from a specific
group ?

I want to do a script like that :

list="1 2 3 4 5 6"
for i in $list
do
usermod -G wheel, staff username$i
done

This will add username[1-6] to group wheel and staff, but how can i do
like this script to remove them in staff group without editing the file
/etc/group ? 

thanks

From: Joachim Schipper
Date: Sunday, December 12, 2010 - 6:22 am

Do some light scripting with an appropriate utility, e.g. userinfo(8).

		Joachim

-- 
PotD: lang/expect,no_tk - sophisticated scripter based on Tcl/Tk
http://www.joachimschipper.nl/

Previous thread: Script for the creation of multiple user accounts by OpenBSD Geek on Sunday, December 12, 2010 - 3:30 am. (2 messages)

Next thread: Re: remove users from group by S Mathias on Sunday, December 12, 2010 - 6:36 am. (1 message)