bash - echo the cat content into a file -



bash - echo the cat content into a file -

i have file "setting.xml" contains environment variable

<localrepository>/users/$(whoami)/.m2/repository

i want write content of setting.xml production.xml , replace $(whomai) userid

i tried below

cat setting.xml | echo > production.xml

but not sure how can pass content echo command

you can try:

sed "s/\$(whoami)/$(whoami)/" < setting.xml >production.xml

the sed stream editor, , in above, replaces literal $(whoami) result of command whoami.

bash environment-variables echo cat

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -