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.
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.
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