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 | |
by tachyon (Chancellor) on Feb 17, 2003 at 19:08 UTC |