By A-V
Hello all
I have a situation and would be grateful if you will help me… I am not sure whether it is even possible
I have few folders/directories —e.g. A – B – C -in my MAIN directory
for each of them I would get the data from folder called DATA and go through a long list of actions which involves creating new sub-directories.
So e.g. will run a program for A -> creating 5 new sub-directories – doing some calculations and getting some results out
the same happens for B and C
I have tried to put an FOR loop around it which seems to work if I only have one of them there as the address for the directories will get confusing as my program refers to sub-directories in the A,B,C
Code:
###for A
FILES="A/*"
for X in $FILES
do
FILES="data/*"
for X in $FILES
.
.
.
done
##for B
FILES="B/*"
for X in $FILES
do
FILES="data/*"
for X in $FILES
.
.
.
done
Now my problem is how to adapt it so when I am on MAIN, I can run all of them at the same time and related directories would be created inside each of them separately …
the Path seems something like this
Code:
MAIN/A/ -> data, id, count, count/result
MAIN/B/ -> data, id, count, count/result
MAIN/C/ -> data, id, count, count/result
I am not sure whether something like this is possible … or they might be a very simple solution but my mind is not supporting now
Thank you in advance
Anna
Source: FULL ARTICLE at The UNIX and Linux Forums