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