[mdlug] OT: perl help (easy)

dean mdlug at sbcglobal.net
Tue May 8 22:02:13 EDT 2007


Hello, I have a perl question, and I'm thinking some people will say, 
this is very easy, figure it out yourself.    But if someone will help, 
it will save me some time, and time is kind of critical.  

I want to use perl copy the same file (/tmp/foo.c) to
multiple directories that all have the format:

/PATH/data.

I have a file, idlist, that contains all the usernames, one per line each:

usernameA
usernameB
.
.
.
usernameZZ

This is how I tried to do it, in perl:

open (SAP,"/tmp/idlist");
while (<SAP>)  {

chomp;

system ("cp /tmp/foo.c /PATH/data");
system ("chown $_ /PATH/data/foo.c"); 
}

But this is not working, for reasons that I'm sure will be obvious to many.
Would anyone be so kind as to provide a corrected perl program that will do
this?

 Thanks.  I say OT because it's Solaris.  











-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.







More information about the mdlug mailing list