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

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -