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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, July 27, 2005 10:39 AM
To: Adrian Phillips
Cc: [EMAIL PROTECTED]; Help-cfengine@gnu.org
Subject: Re: Editing fields in /etc/passwd
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, July 27, 2005 10:39 AM
To: Adrian Phillips
Cc: [EMAIL PROTECTED]; 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
<[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 07/27/2005 12:13 PM |
|
>>>>> "David" == David E Nelson <[EMAIL PROTECTED]> 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
_______________________________________________ Help-cfengine mailing list Help-cfengine@gnu.org http://lists.gnu.org/mailman/listinfo/help-cfengine