1
The situation is as follows, I have 3 variables available:
numlinha
-> line number to be replaced
texto
-> line text that will be replaced(I would prefer to use the line number but this is here if it works better)
texto_sub
-> text that will be replaced
The goal is to replace a line in the file.txt, in case it works I can also use another search variable instead of the entire line.
I tried to do something like sed -i '/$texto/c\$texto_sub' file.txt
but it doesn’t work in the bash script.
The ideal solution for me was to replace with the line number but nothing I tried and saw worked.