Hi,
I have a file where there are 10 lines.
In a shell script i get some user input, Now i have to update the lines 2,4,7 (example) in that file. and update the contents of the file with these values.
I can do it by writing to a temporary file and then renaming the file. I don't want to create files and do. Is there any way to do it without creation of temp. files. I know there are way, one way i remember use vi editor inside the shell script. But i forgot how to do it,
i tried something like this,
vi $noiseparam << eoffile
:s/$ngenip/$tngenip/g
:s/$chan1/$tchan1/g
:s/$chan2/$tchan2/g
:wq
eoffile
inside the shell script, it did not work,
can you guys give a solution?
Thanks in advance
I have a file where there are 10 lines.
In a shell script i get some user input, Now i have to update the lines 2,4,7 (example) in that file. and update the contents of the file with these values.
I can do it by writing to a temporary file and then renaming the file. I don't want to create files and do. Is there any way to do it without creation of temp. files. I know there are way, one way i remember use vi editor inside the shell script. But i forgot how to do it,
i tried something like this,
vi $noiseparam << eoffile
:s/$ngenip/$tngenip/g
:s/$chan1/$tchan1/g
:s/$chan2/$tchan2/g
:wq
eoffile
inside the shell script, it did not work,
can you guys give a solution?
Thanks in advance