How can I replace a "
by \"
inside a string using bash?
For example:
A txt-File contains text like:
Banana "hallo" Apple "hey"
This has to be converted into:
Banana \"hallo\" Apple \"hey\"
I tried
a=$(cat test.txt)
b=${a//\"/\"}}
But this didn't work.
How does that work?