Skip to main content
edited title
Link
user313992
user313992

loop to traverse subdirectories and execute a perl script into each subdirectoriesubdirectory

Source Link

loop to traverse subdirectories and execute a perl script into each subdirectorie

I have a parent directory with multiples subdirectories like this

Parent_directory subdirectory_1 perlscript.pl file.fasta subdirectory_2 perlscript.pl file_2.fasta 

And I would like to run the perl scipt in each subdirectory. I'm trying with the next command

find . -type d | while read d; do perl hoz-3-v1c.pl $d/* ; done 

but the output is directed to the parent directory and I want the output in each subdirectory