fork(1) download
  1. #!/bin/bash
  2. s='localhost,127.0.0.1,.myfancy.domain,.myotherfancy.domain'
  3. sed 's/,\.\{0,1\}/|/g' <<< "$s"
Success #stdin #stdout 0.01s 5460KB
stdin
Standard input is empty
stdout
localhost|127.0.0.1|myfancy.domain|myotherfancy.domain