Shell script variable inside sed instructions?
May 1, 2007 3:52 PM
Subscribe
Using shell script variables inside sed instructions?
This uses the literal value of the variable name, rather than the value:
cat $PRODUCTION_URL.com.conf | sed -e 's/ServerName .*/ServerName $PRODUCTION_URL/' -e 's/ErrorLog .*/ErrorLog logs\/$PRODUCTION_URL-error_log/' -e 's/CustomLog .*/CustomLog logs\/$PRODUCTION_URL-access_log common/' > $PRODUCTION_URL.com.conf
What needs to be done to the sed instructions to make it use the value of the variable?
posted by xmutex to computers & internet (12 comments total)
1 user marked this as a favorite
posted by synaesthetichaze at 3:54 PM on May 1, 2007