[TriLUG] OT - Help merging multiple files into a single file
Scott Lambdin
lopaki at gmail.com
Thu Nov 8 08:59:44 EST 2007
Wouldn't "cat * | sort | uniq > /tmp/newsudoers" put stuff in the wrong
sections? Don't have a sudoers file in front of me so I am going by memory.
On 11/8/07, Robert Dale <robdale at gmail.com> wrote:
>
> On Nov 7, 2007 4:09 PM, <howard.x.boyd at gsk.com> wrote:
> > Could someone please suggest a unix command or utility that will help me
> > merge the contents of multiple files into a single file. We currently
> have
> > 200+ AIX systems with a /etc/sudoers file on each server. The contents
> of
> > these files may or may not be the same. The goal is to examine the
> > contents of all the files and merge them into a single master sudoers
> file
> > that will be maintained and periodically pushed out to all the servers.
> > Would appreciate any suggestions or ideas on how best to accomplish this
> > task. Thanks,
>
> What are the rules?
>
> What determines a command match?
> Are aliases LCD or additive?
> How to resolve conflicts?
>
> You certainly could do "cat * | sort | uniq > /tmp/newsudoers" (Andrew
> Perrin) and then manually merge from there. To cut down on whitespace
> differences, you could run sed on all the files to remove leading,
> trailing, and any excess whitespace in between.
>
> I imagine it wouldn't be too hard to write a perl script to do per
> field merging.
>
> --
> Robert Dale
> --
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
>
More information about the TriLUG
mailing list