only uppercase first character?

should be a simple question, I am trying to uppercase every first character in a word on the list.

abc
google
cnn
services

My first thought was sed 'y/^[a-z]/^[A-Z]/', but it changed all the characters, not just the first character.

any thoughts?

## Following extract the first initial character only:
sed 's/\(.\).*/\1/' input_file > $$FirstChar

## Following extract from the second character on:
sed 's/.\(.*\)/\1/' input_file > $$OtherChars

## Following changes the first character to upper case:
tr '[a-z]' '[A-Z]' < $$FirstChar > $$UpperChar

## Following paste together the upper case character and
## the other characters:
paste -d'\0' $$UpperChar $$OtherChars

## Following removes temporary files:
rm -f $$*

if you have python here's an alternative:

# echo "astring"  | python -c "print raw_input().capitalize()"
Astring
ex - infile<<!
%s/^./\u&/|x
!

Hi.

Also in perl:

#!/bin/sh

# @(#) s1       Demonstrate quickie perl for uppercase first character.

FILE=${1-data1}

perl -wp -e '$_ = ucfirst' $FILE

exit 0

run on your sample in file data1 produces:

% ./s1
Abc
Google
Cnn
Services

cheers, drl

A more general version for one or more words on a line:

awk '{ for ( i=1; i <= NF; i++) 
           {   sub(".", substr(toupper($i),1,1) , $i)  }  
            print }' file

use nawk/gawk/mawk as appropriate if awk doesn't work

This is with GNU sed:

cat bla.txt | sed 's/\([a-z]\)\([a-zA-Z0-9]*\)/\u\1\2/g'

no need for cat. Also you revived a 1 year plus thread.