There you go:
Dear all
I'm a bash newbie trying to do the following. I currently have a folder called "100-mT", which contains several subfolders. I am looking for a way to perform the following steps in each iteration in a for loop (for idx in 200 300 400 500 600 700 800 900 1000) in the bash environment:
(i) Copy the folder "100-mT", and rename it to "idx-mT" (I would also be interested in knowing how, when idx=1000, the folder name becomes "1-T", but it is secondary)
(ii) Search in each of the subfolder…
Dear all
I have created a bash script that cd at different subfolders and perform an action (sbatch)
# Let's loop over all subfolders
for idx in 100 200 300 400 500 600 700 800 900 1000;
do
# Let's copy, paste, and rename the relevant folder
if (("$idx"<1000));
then
cd "$idx-mT";
else
cd "1-T";
fi
for Geometry in Rectangular-Sample Square-Sample;
do
cd "$Geometry";
for Temperature in 0-K 2-K;
do
cd "$Temperature";
…
And so far, how is it going for you?
Maybe reading this section of Bash manual can shed some light on how "brace expansion" mechanism works, and a longer one about parameter expansion .