Change to uppercase

Hi I have a string(can be mix of upper and lower case) and need the first three chars of the string to be converted to uppercase

try this,

echo "teStforyou" | awk '{print toupper(substr($0,1,3))substr($0,4)}'

if you have ksh 93 you can use:

typeset -u F3
STR="teStforyou"
F3=${STR:0:3}
STR=${F3}${STR:4}

With GNU sed

$ echo "teStforyou" | sed 's/\(^...\)/\U&/'
TEStforyou
v=kerflooey
echo "$( echo "${v%${v#???}}" | tr '[:lower:]' '[:upper:]')${v#???}"