I think that what you're searching for is globbing.
Code:
for f in ./SF*/AAA/file1.ppm; do
# do something here with the variable "$f"
# example: echo "$f"
done
The asterisk in «
SF* » means that there is something after «
SF », so if you have a directory called
SFabcd it'll catch it too.
If you want to specify that what follows «
SF » is a digit:
Code:
for f in ./SF[[:digit:]]/AAA/file1.ppm; do
...
If you want to specify instead that there is only one character (which can be a digit) after it:
Code:
for f in ./SF?/AAA/file1.ppm; do
...
If you want to be precise and say that what follows it is a number, you'd use
extglob:
Code:
shopt -s extglob
for f in ./SF+([[:digit:]])/AAA/file1.ppm; do
...