#! /bin/sed -f

# capit.sed -- capitalize words 
# 
# $Id: capit.sed,v 1.4 1998/07/06 20:32:46 cdua Exp $
# Carlos Duarte, 970519

# split words into \n word
s/[a-zA-Z][a-zA-Z]\+/\
&/g

# add conversion table: \n\n table
# table format: <to-char> <from-char>
s/$/\
\
AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz/

# subs every lower case first char
ta
:a
s/\n\(.\)\(.*\n\n.*\)\([A-Z]\)\1/\3\2\3\1/
ta

# cleanup...
s/\n\n.*//
s/\n//g

