change sed delimiter when dealing with urls
Closed this issue · 1 comments
nyxnor commented
Aiming to removeREPLACEMENT_STR
for example:
Line 1078 in 8e24af1
use
|
as delimiter.
$ echo $GO_DL_PATH
https://golang.org/dl/
$ cat example.txt
GO_DL_PATH=
$ sed "s|GO_DL_PATH=.*|GO_DL_PATH=${GO_DL_PATH}|" example.txt
GO_DL_PATH=https://golang.org/dl/
This does not work with []
which happens to be on ipv6 bridges. So this can't be changed yet until a compatible delimiter is found:
Line 137 in 8e24af1
I mean, yeah, replacement string substitutes every character that could break regex, but it is not necessary when dealing with links.
radio24 commented
This is a good point, and I will add this to CONTRIBUTING.md. When changing/adapting the code, that can be taken into account. However, I won't spend my time changing this in about 90 places in the code.