in reply to need scripts to scan directories and interpret results

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

Replies are listed 'Best First'.
Re: Re: need scripts to scan directories and interpret results
by kumar (Initiate) on Feb 17, 2003 at 16:45 UTC
    Thanks a lot for your help. Excellent Performance. I am new to this site... so i don't have any idea to award points/grade to the help. Could you please help me to solve my second part? Thanks and regards

      I wrote New Monks a couple of years ago which is as good a place to start as any. Also Guide to the Monastery and Perl Monks Site FAQ and Site How To

      Just a hint. If you post code, even really really bad code, you tend to get more help than if you just state a problem and ask for a solution. Most of us are PAID to deliver solutions. We offer help as a gesture of good will (or we do it on the bosses time ;-) Hey wait a minute. I am the boss.

      cheers

      tachyon

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