searching sed inplace from stdout
by vijaytamil2000 from LinuxQuestions.org on (#4W5SR)
Hello Folks,
I am searching a command where i want to write the replace string into files.
Below are the scenarios.
I have file called test.txt and the below are the contents.
[wininstall]
server1fqdn: server1.com
server1comps: ifwe=False ifge=False ifze=False
server2fqdn: server2.com
server2comps: ifwe=False ifge=True ifze=False
[endwininstall]
Now i am trying to replace 'ifge=True' to false in the text.txt file.
I tried the below commanad:
cat test.txt | grep -w server2comps | cut -d ":" -f2-14 | grep -oP 'ifge[^[:blank:]]*' | sed 's/True/False/g'
output:
ifge=False
But my question is how can write this changes in file directly using 'i' option.
Can any help me out this.


I am searching a command where i want to write the replace string into files.
Below are the scenarios.
I have file called test.txt and the below are the contents.
[wininstall]
server1fqdn: server1.com
server1comps: ifwe=False ifge=False ifze=False
server2fqdn: server2.com
server2comps: ifwe=False ifge=True ifze=False
[endwininstall]
Now i am trying to replace 'ifge=True' to false in the text.txt file.
I tried the below commanad:
cat test.txt | grep -w server2comps | cut -d ":" -f2-14 | grep -oP 'ifge[^[:blank:]]*' | sed 's/True/False/g'
output:
ifge=False
But my question is how can write this changes in file directly using 'i' option.
Can any help me out this.