PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Tools/capitalize

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