sh-2.02$ w=/usr/share/dict/words sh-2.02$ sed -n /^[a-e].*xy$/p $w apoplexy boxy carboxy epitaxy epoxy sh-2.02$ grep ^[a-e].*xy$ $w | sed s/p/m/ amoplexy boxy carboxy emitaxy emoxy sh-2.02$ grep ^[a-e].*xy$ $w | sed s/p/m/g amomlexy boxy carboxy emitaxy emoxy sh-2.02$ sed -n /^[a-e].*xy$/s/p/m/gp $w amomlexy emitaxy emoxy