Tags

, , , ,

If you want to replace dots in a string, for example “a.string.with.dots”, by hyphens use the following trick

 

$ echo "a.string.with.dots" | tr  "."  "-"

That’s it!

 

Needless to say, other characters may also be substituted this way.

Advertisements