I have 3 directories named: /home/user/control4 , /home/user/control8 ,/home/user/control16
I have written a script file which has two loops , the first one is running a simulation, producing 3 files named cc1.txt cc2.txt, and cc3.txt and a second loop is for the names of directory
I like to direct cc1.txt, cc2.txt, cc3.txt to /home/user/control4,/home/user/control8 ,/home/user/control16, respectively. What is the exact syntax for doing this in BASH?
Thanks for your help.
My script file look likes this
#!/user/bin/bash
for j in $(4 8 16 ) # loop for directories
do
for i in $(seq 1 3) # loop for simulations
do
.... produce cc1.txt cc2.txt cc3.txt
done
How to output the three files to the respective directories? something like /home/user/control$j/cc$i.txt?
done
That will produce nine files. If you want one file per directory for a total of three files, some math might do the trick.