Bash allows you to perform pattern replacement using variable expansion with sed(stream editor).
To replace a value means, we're searching for this value and replacing it with another one.
To replace all e's with a upercae X:
echo "replace all es in this line" | sed 's/e/X/g'
rXplacX all Xs in this linXRemoving is also a kind of replacement. We're searching for value and replacing it with nothing.
echo "remove all spaces of this line" | sed 's/ //g'
removeallspacesofthislineIn my cases, special characters are characters like: :, / and so on.
To remove the scheme of an URI including ://:
echo "https://www.example.com" | sed 's#https://##g'
www.example.comHere I use # instead of / for sed to avoid conflicts with the searching value: https://.