0

I need to replace a number using a script, I am using the following command

 for ((i=1; i=<10, i=i+1))
sed '244s/0.8/(0.$i)/' analyze3big.f >> $i.f 

But for some reason it does not work.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232

1 Answers1

2

Strong quotes (') prevent variable expansion. Use weak quotes (") instead:

for i in {1..10}; do
    sed "244s/0\.8/(0.$i)/" analyze3big.f >> $i.f 
done
DopeGhoti
  • 76,081