#! /bin/sed -f # Laurent Le Brun - 2007 :loop s/^\(.\)\(.*\)\1$/\2/ tloop /../{ i no b end } i yes :end d