bash - How to replace ${} placeholders in a text file? -


i want pipe output of "template" file mysql, file having variables ${dbname} interspersed. command line utility replace these instances , dump output standard output?

sed!

given template.txt:

 number ${i} word ${word} 

we have say:

sed -e "s/\${i}/1/" -e "s/\${word}/dog/" template.txt 

thanks jonathan leffler tip pass multiple -e arguments same sed invocation.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -