I try to use sed to change a line in a file named convergence.gnu
I have a variable named lafila, which is a file name
Currently, I can do:
lafila="nGas060.dat"
sed -i "6s/.*/plot \"$lafila\" using 1:2 with l/" convergence.gnu
This changes correctly the sixth line of my convergence.gnu file to:
plot "nGas062.dat" using 1:2 with l
However, now I want to include a dollar sign in the replaced line to obtain instead:
plot "nGas062.dat" using ($1/1000):2 with l
Can you tell me what to change in my sed command? If I escape a dollar sign it does not work properly. Double dollars also don't work.