Nick Guenther wrote on Sat, Oct 28, 2006 at 11:21:40PM -0400:
> On 10/28/06, Leonardo Rodrigues <[EMAIL PROTECTED]> wrote:

>> Actually, it wouldn't be practical to manually edit /etc/group.
[...]
>> Also, er, call me dumb, but after rereading usermod(8), I really see
>> no way to explicitly remove an user from a group... =(

[...]
> As a hack, could you write a short script to edit it and call that?

cd /etc \
&& sed '/^foogroup/s/baruser,*//' < group > group.new \
&& mv group.new group

This is a noop unless baruser is a member of foogroup,
but it changes the /etc/group ctime even then.  Hm.

cd /etc \
&& sed '/^foogroup/s/baruser,*//' < group > group.new \
; diff group group.new \
&& rm group.new \
&& echo no change \
|| mv group.new group

Reply via email to