Here is one sed command that uses only the POSIX sed functions:
sed -e 'h;s,^\(.\).*$,\1,;y,ABCDEFGHIJKLMNOPQRSTUVWXYZ,abcdefghijklmnopqrstuvwxyz,;G;s,\ .,,'
These are two lines, the first line ending with a backslash to quote a newline character.
source share