I want to remove double dot from a string but not the single dot using shell script.
example string: a..b.c
expected output: ab.c
I tried tr -d ".." but its removing all the dots. I tried tr -d "\.\." then also same result "abc".
Any suggestions would be appreciated.
You can replace multiple dots with none:
sed -E 's/\.\.+//g'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With