I'm using sed to find configuration directives in a php file. Essentially, I need to set the strings
password_here with their appropriate values in the config-sample.php (and rename the file to config.php). My current solution uses sed three times, redirecting the output to temporary files.
sed -e 's/database_name_here/foo/g' config-sample.php > /tmp/config.1 sed -e 's/username_here/bar/g' /tmp/config.1 > /tmp/config.2 sed -e 's/password_here/bat/g' /tmp/config.2 > config.php
I was wondering how I could achieve the same results without having to create two temporary files?