Based on: sed: Replace part of a line
I want to modify my sysctl.conf
file. The line which contains PermitTunnel something
must be changed to PermitTunnel point-to-point
.
So using as one man said in the post before, I would use:
sed -e 's/PermitTunnel.*$/PermitTunnel point-to-point/g'
Including at the end of the line my file.
Since -n
is not used, I guess I'm expected to receive at standar output the result of my operation. Then I executed it and get (notice I'm using -2-
instead of -to-
just in order to see if I can modify the file as I want, because the file already have the desired line at this case):
root@debian:/home/dit# sed -e 's/PermitTunnel.*$/PermitTunnel point-2-point/g'/etc/sysctl.conf
PermitTunnel point-2-point
But then I do:
root@debian:/home/dit# cat /etc/sysctl.conf | grep PermitTunnel
PermitTunnel point-to-point
So as you can see, the file has not changed. What am I doing wrong?
Thanks for reading