1
rated 0 times
[
1]
[
0]
/ answers: 1 / hits: 1756
/ 3 Years ago, mon, november 22, 2021, 4:37:07
I want to write backslashes in a file, and I try to substitute some text with the value from a variable:
$ TEST=etchello
$ echo $TEST
etchello
But the backslash is missing when I tying to replace them using sed -i
$ sed -i "s/target_value/$TEST/" $(pwd)/test.txt
results "etchello" in test.txt
I expect the file to contain etchello
.
More From » bash