Shell script variable inside sed instructions?
I.e.: 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 However, you may want to redirect your output to a different file to avoid clobbering the one you are editing…. such as $PRODUCTION_URL.com.conf.