Hi All, I need to change the ownership of about 1e6 files from 17 old owners to 17 new owners. the files are in multiple directories. I can run "chown -R" 17 times in the top directory but I thought there must be a more efficient way and perl is probably my best bet. Instead of using chown which will go over the same file 17 times I was looking at a more intelligent solution which inspects each file individually and checks if the owner is one of the 17 old ones and changes the ownership to the new owner. I assume that this would be much quicker as well. My perl knowledge is limited so I was hoping one of you can help me out. Of course I'm not necessarily asking you to write the script for me but maybe just pointing me in the right direction.

In reply to if owner A change to owner B by martap

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.