I need to replace a line in a file. The new line includes path, spaces, comma and quotes.
Replace this line: "download-dir"
Into this one: ___"download-dir": "/basedirectory/downloads",
(underline replacing space)
I'm running sed -i
through bash script and I used "$(dirname $(readlink -f $0))"
to get the base directory (basedirectory/downloads).
All I was able to do was sed -i '/"download-dir"/c\'"$(dirname $(readlink -f $0))"/downloads ~/arq
, which would change the line partially to what I want.
However, I couldn't add ___"download-dir":_
(underline replacing spaces) before the path and a coma after it.
Suggestions, please?