PageRenderTime 18ms CodeModel.GetById 14ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Tools/capitalize

#
Shell | 5 lines | 2 code | 0 blank | 3 comment | 0 complexity | 1e9e9d2e33184b5bd36d6bc60ba81824 MD5 | raw file
1#!/bin/sh
2# usage: capitalize word
3# write word to stdout w/ first character upcased
4first_char=`echo $1 | sed 's/^\(.\).*/\1/' | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
5echo ${first_char}`echo $1 | sed 's/^.//'`