I have a directory named ../words that contains a number of subdirectories(words/blabla,words/blabla), in turn each subdirectory contains two types of files (.*1.txt) and (.*2.txt) .What I need, it is to run an AWK script against each one of these files.Could it be something like?for d in words/*do    for f in .*[0-9].txt    do    awk -f script.awk ${f}donedone
Iterate through subdirectories and execute an awk script against certain files
bash;shell script;awk
If you're using a modern shell like bash or zsh, you can use something like:for i in words/*/*{1,2}.txt; do awk -f script.awk $i; doneIf, for whatever reason, you need compatibility with /bin/sh, you can use this slightly more verbose and less readable solutionfor i in words/*/*1.txt words/*/*2.txt; do awk -f script.awk $i; done 