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: Frank Ranner
Subject: Re: Editing fields in /etc/passwd
Date: Sun, 31 Jul 2005 20:50:42 +1000
User-agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

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



reply via email to

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