I\'m trying to replace /./
or /././
or /./././
to /
only in bash script. I\'ve managed to create regex for sed but it doe
Two things to make it simple:
$ variable="something/./././"
$ sed -r 's#(\./){1,}##' <<< "$variable"
something/
{1,}
to indicate one or more patterns. You won't need g
with this.#
in above case to make it readable+
is ERE so you need to enable -E
or -r
option to use it