I stumbled upon this variation of sed today in my company's codebase.
Essentially we want to swap out ssh://git@
for https://
for our CI.
I found this syntax pretty strange and have not been able to find documentation for it on google... Could someone link me to some documentation or provide some insight?
I see it written this way, with ^
separating the search and replace strings. This has removed the need for the /
separator as well as any escapes. Is this maybe a regex trick?
sed 's^ssh://git@^https://^g' -i terraform.tfvars
It performs the same as this. Which is what I would have written originally. But the one above just seems so much cleaner and more readable.
sed 's/ssh:\/\/git@/https:\/\//g' -i terraform.tfvars
Some insight is greatly appreciated! Thanks in advance.