Welcome to PerlMonks a place where those who try to help themselves first get far more help than those who want free code written for them. You probably want something like this. I will put in as much effort on documentation and explanation as you have with posting code. Uncomment the `bactic shell code` only after you have done a dry run so you can see what it plans to execute. You can save a lot of time with scripting.....or create the most enormous disaster in no time flat.

#!/usr/bin/perl @users = glob("/home/sites/$ARGV[0]/users/*"); @mail = glob("/home/spool/mail/*"); @mail{@mail} = @mail; for my $userpath ( @users ) { my ($username) = $userpath =~ m!([^/]+)$!; next unless $mail{"/home/spool/mail/$username"}; print "Copying $username.....\n"; print "Plan: /bin/cp /home/spool/mail/$username /home/sites/home/w +eb/move\n"; #`/bin/cp /home/spool/mail/$username /home/sites/home/web/move`; }

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


In reply to Re: need scripts to scan directories and interpret results by tachyon
in thread need scripts to scan directories and interpret results by kumar

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.