#!/bin/sed -f 1i\ \
\ s,\&,\&,g s,",\",g s,<,\<,g s,>,\>,g # You may see two odd-looking characters below when displaying this script # on-screen; they should be literal backspaces (ASCII 8). s,_\(.\),\1,g s,,,g s,\(.\)\1,\1,g s,,,g $a\