On Sun, Dec 12, 2010 at 03:44:18PM +0400, OpenBSD Geek wrote:
> 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 ?
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/