I need to iterate through the subdirectories of a directory and take two of the files, as arguments of an awk script. The script will compare the two files and generate other files.
I've this. But I need awk script to take as an argument files. ".*1.txt" and ".*2.txt"
for i in words/*/*1.txt words/*/*2.txt do awk -f corpus_vs_flexion.awk "$i" done
awk -f corpus_vs_flexion.awk .*1.txt .*2.txt # Taking them from each subdirectory in words/* Directory words/ subdirectory Peter/ whatever.txt whatever1.txt whatever.txt whatever.txt whatever2.txt subdirectory Blas/ whatever1.txt whatever.txt whatever.txt whatever.txt whatever2.txt ........./ ..... .. For each subdirectory loop: awk -f corpus_vs_flexion.awk whatever1.txt whatever2.txt