Changing sed in loop
Hi
I am trying to find out how to change the value of the inputs in sed while looping As such: for i in `seq 1 10`; do "do something funny, using OpenFOAM" cd system sed 's/oldvalue/oldValue+increment/' -i sampleDict cd .. done So basically, can you for instance create a constant "a" and increase it for every loop interval and use it for sed? Appreciate the help, n00b-warning. |
Hi,
Is this what you are looking for: Code:
#!/bin/bash Hope this helps. Remove the echo in front of the sed statement if this is to your liking. |
Not knowing what oldvalue or the increment are, not even knowing if they are numbers, it's hard to answer well but something like this:
Code:
oldValue=5 |
All times are GMT -5. The time now is 11:51 PM. |