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: Martin, Jason H
Subject: RE: Editing fields in /etc/passwd
Date: Wed, 27 Jul 2005 10:44:19 -0700

If editfiles isn't up to the task, you could always create a shell command based around sed that fixes the file for you. You could predicate that shellcommand on some other class that first determines if the fix needs to be made.
 
-Jason Martin
 
-----Original Message-----
From: help-cfengine-bounces+jason.h.martin=cingular.com@gnu.org [mailto:help-cfengine-bounces+jason.h.martin=cingular.com@gnu.org]On Behalf Of david.nelson@ni.com
Sent: Wednesday, July 27, 2005 10:39 AM
To: Adrian Phillips
Cc: help-cfengine-bounces+david.nelson=ni.com@gnu.org; Help-cfengine@gnu.org
Subject: Re: Editing fields in /etc/passwd


Yes, it would.  However, the passwd file format is "<user>:x:<uid>:<gid>...." and I can't guarantee that the '<uid>' will be consistent accross all systems.  This is where I'm running into problems in how to preserve the '<uid>' field.

Regards,
         /\/elson



Adrian Phillips <a.phillips@met.no>
Sent by: help-cfengine-bounces+david.nelson=ni.com@gnu.org

07/27/2005 12:13 PM

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





>>>>> "David" == David E Nelson <david.nelson@ni.com> writes:

   David> Looking through 'editfiles', I'm not seeing an easy way to
   David> edit a single field in /etc/passwd - I need to change the
   David> primary group for one account.  I can't just replace the
   David> entire line since the Gecos and home dir aren't consistent
   David> across systems.  Any ideas?

Won't something like the following work :-

ReplaceAll "^<user>:x:<groupid>:" With "<user>:x:<new groupid>:"

Sincerely,

Adrian Phillips

--
Who really wrote the works of William Shakespeare ?
http://www.pbs.org/wgbh/pages/frontline/shakespeare/


_______________________________________________
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]