Artificial intelligent assistant

How to capitalize word (i.e. first letter to upper) in KornShell Is there a builtin way in KornShell to capitalize a word, e.g. `korn` -> `Korn`? A Bash 4 example to clarify: str='korn' echo "${str^}" If there is not a bultin way to do this in KornShell, what is the most concise and efficient way to write a function that will do it?

Here is a pure ksh (ksh93) way:


function cap {
typeset -u f
f=${1:0:1}
printf "%s%s\
" "$f" "${1:1}"
}

$ cap korn
Korn

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy cf9a418807408986fa37f1346ca27277