Hello,
I am going through a large web file. Separating files from
directories. Then I wish to check the permissions and ownership on each file/directory.
I have started this script:
#!/usr/bin/perl -w
use File::Copy;
$dirs="";
$files="";
@array=qx(ls -R /web/);
foreach $files(@array) {
chop($files);
if(-f $files) {
qx(cat $files >> /tmp/files);
} else {
qx(cat $files >> /dirs);
}
}
obvisiouly I am not doing this right. In the above piece
I am just trying to test if a name from the array is a file
or directory. If it is a file I put it in one file and directory in another. What am I doing wrong???
I am going through a large web file. Separating files from
directories. Then I wish to check the permissions and ownership on each file/directory.
I have started this script:
#!/usr/bin/perl -w
use File::Copy;
$dirs="";
$files="";
@array=qx(ls -R /web/);
foreach $files(@array) {
chop($files);
if(-f $files) {
qx(cat $files >> /tmp/files);
} else {
qx(cat $files >> /dirs);
}
}
obvisiouly I am not doing this right. In the above piece
I am just trying to test if a name from the array is a file
or directory. If it is a file I put it in one file and directory in another. What am I doing wrong???