calling director, bash script
Hello to all
I am totally new to linux and appresiate any help.
I have a bash script c2c12_4%.sh which does an iteration over my data set.
I have a main directory called 4%GXG and in that directory I have 3 sub directory (GXG_A, GXG_B, and GXG_C). In GXG_A i have 10 files (similarily with GXG_B & GXG_C), and each file has 4 sub files. The bash script is in each of the 4 directories. If i run the bash script in a terminal it iterates the data in the file and spits the output in the same file. However if I run more than one terminal it takes forever to iterate and many times crashes. I know there is an easy way as writing a loop which calls the directories and iterates the script but that is where I dont know where to start. I checked online but I couldn't find anything concrete or at least close to what I want. Do you have any ideas of how to do this.
S0 basically the following:
4%_GXG-->GXG_A, GXG_B, GXG_C----> in each (cell1 ...cell10)---> in each (A, B, C, D) ---> in each (data and bash script)
Very greatful for any help.
Hi, welcome to LQ!
Sorry, but to me that description means little. Can you post
an output of
Well 4%GXG basically refers to my file directory. I just gave it a name.
So the tree looks like
| | |
plate1 plate2 plate3
| | |
| | _________|__________________
| | | | | | | | | | | |
| | c1 c2 c3 c4 c5 c6 c7 c8 c9 c10
| | | | | | | | | | |
| c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 |
| | | | | | | | | |
c1 c2 c3 c4 c5 c6 c7 c8 c9 c10
So each plate has 10 directories and within that 10 there are 4 other directories (calling it **). Each directory in ** has the bash script and the data which undergoes iteration from the script analysis.
I would like to combine this such that I tell it to go into file 4%GXG and into plate 1, c1 to c10, then into the ** and finally iterate the data in all files...after it is done it goes to plate 2, repeats everything, then plate 3.
I hope that made sense :)
Thank you again
1. Here is what I hoped would happen ______________________
2. But here is what happened instead ______________________
3. Here is how (2) differs from (1) _______________________
Imagine that your post will be read by someone who doesn't already know what you want. The reason? Your post will in fact be read by someone who doesn't already know what you want.
A basic soln, assuming the same script is used to process all data and you pull that script out to a top level dir and there are only the dirs/files
Note that your orig post seems to randomly interchange the words 'file' and 'dir', which is confusing.
Welcome to LQ
My goal is to go into the directories and sub-sub directories and tell it to execute the following XYZ.sh file for all the sub-directories under the main directory 4%GXG.
I apologize if I was unable to be clear, my sincere apologies again.
Thank you in advance
What I (always) suggest is to create a small test copy eg just 2 dirs at each level, and just 2 data files in each bottom dir and try a test execution.
Maybe start with just listing the filenames instead of processing them and add an
echo "in $dir"
or equiv at each level so you can see what the prog does.
With the links I supplied, you should easily be able to finish it from there.
|All times are GMT -5. The time now is 10:28 PM.|