When using envsubst to replace values in a file, it creates a newline when it appends to a string. How do I prevent it from inserting a newline when saving it to a new file?
Environment Variable:
foo=bar
File:
$foo\\text\\word,$foo\\text2\\word2,$foo\\text3\\word3
Command:
envsubst < test.properties > temp.properties
Undesired output:
bar
\\text\\word,bar
\\text2\\word2,bar
\\text3\\word3
Desired output:
bar\\text\\word,bar\\text2\\word2,bar\\text3\\word3