endervalentine
Senior member
I'm new to perl and what I'm trying to do is to write a script that would search a specified directory and all it's subdirectories and output the files that have the same filenames. I do have a script written in bash that would spit out the files with the same chksum using sort|uniq but I can't figure out a way to do it by filenames and it has to be in perl.
As part of the script above I wanted to stuff an array with the directories at the highest level and can loop through that.
I'm having trouble getting an array with just the directory names ... I'm using perl to call a unix command and store the results into an array, but I can't seem to get the syntax correct.
@dir = split(/ /,`ls -l | grep ^d | awk '{print $8}'`);
print "@dir\n";
The command, ls -l | grep ^d | awk '{print $8}', works by itself but I can't get the syntax correct in perl.
thanks in adv!
As part of the script above I wanted to stuff an array with the directories at the highest level and can loop through that.
I'm having trouble getting an array with just the directory names ... I'm using perl to call a unix command and store the results into an array, but I can't seem to get the syntax correct.
@dir = split(/ /,`ls -l | grep ^d | awk '{print $8}'`);
print "@dir\n";
The command, ls -l | grep ^d | awk '{print $8}', works by itself but I can't get the syntax correct in perl.
thanks in adv!