I am using Sed to find and replace a string in a file. This is the first time working with it so I maybe doing it wrong,
I have a file thats owned by "root" called "test.properties" and I want to replace "world" with "cat".
So I run this command:
sudo sed s/world/cat/ <test.properties >newtest.properties
And it works great, but when I want to write to the SAME file like this:
sudo sed s/world/cat/ <test.properties >test.properties
It says "-bash: test.properties: Permission denied", but I am using "sudo" so why is it denied?