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
Post a Comment