In the tcsh shell on Unix, I would like to print the folder name together with the number of files that I searched, then feed it to a file.
However I just manage to find the number of count then write to a file, not sure how to attach the folder name along.
my_folder.txt contains a list of directory names such as:
dir_1
dir_2
dir_3
foreach a (`cat my_folder.txt`)
find ./netlists/spice/${a}.sp -newermt '8/16/2022 0:00:00' | wc -l >check_latest.txt
end
Now that above code will output just the number of files, such as:
10
5
4
But I look to print out something like this:
dir_1 10
dir_2 5
dir_3 4
May I know how to achieve this?
foreach a (`cat my_folder.txt`)an antipattern in tcsh just likefor a `cat my_folder.txt`or similar would be in a bourne derived shell like bash?