help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Editing fields in /etc/passwd


From: david . nelson
Subject: Re: Editing fields in /etc/passwd
Date: Mon, 1 Aug 2005 09:15:45 -0500


Hi Frank,

This looks like a good candidate for this case.

Thanks for the lead,

         /\/elson



Frank Ranner <franner@NOSPAM.webone.com.au>
Sent by: help-cfengine-bounces+david.nelson=ni.com@gnu.org

07/31/2005 05:50 AM

To
help-cfengine@gnu.org
cc
Subject
Re: Editing fields in /etc/passwd





David E. Nelson wrote:
>
> Hi All,
>
> Looking through 'editfiles', I'm not seeing an easy way to edit a single
> field in /etc/passwd - I need to change the primary group for one
> account.  I can't just replace the entire line since the Gecos and home
> dir aren't consistent across systems.  Any ideas?
>
> It'd be nice if there was an edit command that used a sed-like syntax
> that allowed backreferences.
>
> Thanks,
>      /\/elson
>

Use 'usermod' in a shellcommands section. You could set a class based on
a grep for the old contents, then use that class to trigger the usermod
command.

Regards
Frank Ranner

_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/help-cfengine


reply via email to

[Prev in Thread] Current Thread [Next in Thread]