> how in the world do i do this ?
> i have tried using sed with "y" as follows:
> fname="fwdBldCall"
> nfw=`echo $fname | sed "y/[a-z]/[A-Z]/"`
> echo "fname = $fname"
> echo "nfw = $nfw"
> this is what i get:
> fwdBldCall
> fwdBldCAll
> What am I doing wrong ?
You are using sed unnecessarily and incorrectly. I'll leave it to a
seder to correct your sed usage, but capitalizing the first char
of a variable is easy in ksh.
$ x=abcdef
$ typeset -uL1 f=$x
$ print "${f}${x#?}"
Abcdef
the typeset command creates a special variable that is uppercase,
Left aligned and one char long. ${vname#pattern} trims the first
occurrance of pattern from the start of $vname. '?' matches a single
character.
${x#?} trims the first char from $x and returns the resulting string
Quote:> Thanks in advance!
--
Dan Mercer
Opinions expressed herein are my own and may not represent those of my employer.