I have in my file a line of this kind
integer, parameter :: L = 2 !Size of the system
Where the number 2
can be any integer number. I want to find this line using sed
and replace the value of the number with another one.
I tried:
$ L=5
$ sed -i '/L = /c\integer, parameter :: L = $L !Size of the system' moduleselfcons.f90
but in my modified file I have at the end:
integer, parameter :: L = $ !Size of the system
and not:
integer, parameter :: L = 5 !Size of the system
What is the problem?