I need to list files in hierarchy of directory. For that I wrote script likeforeach file ( * )    ls ${file}/*/*/*/*/*.root > ${file}.txtendBut for this I have to know that in the directory ${file} there are 4 directory. So, Is there any way by which I can generalize this script, such that I did not have to be idea how many subdirectories are present?
List files in hierarchy of directory
shell script;wildcards;recursive;csh
Use the find command.foreach file ( * )    find ${file} -name *.root > ${file}.txtendConsider using a shell other than csh, which has been obsolete for about 20 years. Use zsh or bash interactively, and don't use csh for scripts.