#!/bin/bashs='localhost,127.0.0.1,.myfancy.domain,.myotherfancy.domain'sed 's/,\.\{0,1\}/|/g' <<< "$s"
Standard input is empty
localhost|127.0.0.1|myfancy.domain|myotherfancy.domain
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!