I use sed to find and replace two lines in a file in bash (GNU sed)
This is the file after
-rw-r--r-- 1 websync www-data 4156 mar 27 12:56 /home/websync/tmp/sitio-oficial/sitios/wp-config.php
here is the command that I run
sed 's/www-test/www/g' /home/websync/tmp/sitio-oficial/sitios/wp-config.php > /home/websync/tmp/sitio-oficial/sitios/wp-config.php
and result
-rw-r--r-- 1 websync www-data 0 mar 27 13:05 /home/websync/tmp/sitio-oficial/sitios/wp-config.php
EDIT: If I do not redirect the output of sed, then I got the correct output. If I redirect to a new file, everything works fine.
source share