script to navigate thrugh directories

Hi,

I have a requiremnet where i need to apply logic on directories and sub-direcotories.

Example:

base="/a/b/c"
base1="/a/b/c/d/e"

subfolders in both base and base1 are same : es, ig, os
var1=es
var2=ig
var3=os

Now i have used the follwoing lines in my code and these are creating problem

for dir in "($base | $base1)/$var1" "($base | $base1)/$var2" "($base | $base1)/$var3"

do
(
echo "The current directory is:"`pwd` >> ${LogFile}
cd "$dir" || continue
for i in *.*
do
(
touch "$i" && printf 'Success: %s\n' "$i" || printf 'Failed: %s\n' "$i" >> ${LogFile}
)

  done
\)

done

Please suggest on the above code .
while executing for loop it is not working.

Hi,

for dir in a/b/c/{es,ig,os,d/e/{es,ig,os}}/*
do 
  echo $dir
done

should do it.

HTH Chris

Thank you Christoph.

I have used it in script as below. But it did not work for me.

Please suggest.

for dir in "$base"/{"$var1","var2","$var3",d/e/{"$var1","var2","$var3"}/*

touchfiles1.sh[37]: /a/b/c/{es,ig,os,/d/e/{es,ig,os}/*: not found.

There is a closing brace missing.

What my snippet does it iterates through all of your
directories and will print out the files and directories
in them. You should be able to adjust this to your needs.

Perhaps you should describe in greater detail what
you want to achieve. What is your input, what shall
your output be.