sed 's/\(.\)\(.*\1\)/\2/ s/$/abcdefghijklm/ : s/\(.\)\(.*\)\1/\2/ t /../cImpossible s/^$/abcdefghijklm/ s/./&\n/g'