14

Strip spaces after single capital letters with sed

view full story
linux-howto

http://unix.stackexchange.com – I am writing a bash script to automatically generate some other files, and I have to format some strings a certain way. Specifically, the last problem I'm having is formatting a string that has individual capital letters and a word that starts with a capital letter. For example: O S D Settings needs to become OSD Settings I have a sed command that strips the first space, but it also deletes the "D" (i.e. O S D Settings -> OS Settings). This command is: O S D Settings | sed 's/ \([A-Z]\)* \(A-Za-z]*\)/\1/g' Does anyone know how to delete the spaces in between individual capital letters wi (HowTos)