I have a text file where I'd like to add a string in the beginning of the line, however, it has special characters and sed complains about that.The warning I get is:sed: 1: s/^/curl curliian.bxss ...: bad flag in substitute command: 'b'So I tried to escape the dot:dirnamer=$(dirname $1 | sed 's/\./\\./g')Which didn't work, so I tried to escape the b, which didn't work either. So yeah, this is what I do right now:sed -i '' s/^/curl $dirnamer/g ~/desktop/downloadBut it seems there's alot of problems to do with with sed, because of special characters. What's a better method?
Add variable to beginning of line, not using sed
text processing;sed
This awk command works fine.awk '{print curl $dirnamer| $0;}'Or doing this to the variable before:sed 's/\/b/\\b/g' | sed 's/\/t/\\t/g'