I want to modify a specific line in my code
program main
...
seed=k+rank
...
end
and increment k by intervals of m(=96, in my example). So my implementation of the same in shell should look something like
for k in {1..961..96};
do sed -i "s/{seed=k+rank}/{seed=k+96+rank}/g" main.f90;
#run the program
sleep 15m;
done
but this changes the string seed=1+rank to seed=1+96+rank instead of writing 97+rank and would not proceed on the next iteration.
(Bash script using sed with variables in a for loop? is what I could find)
I've searched for the use of sed through a bash loop but couldn't find or figure out the command specific to my purpose.