You can use Python if this is an option:
After input from different people (thanks to everyone), this seems like a good working solution that matches OP requests for only the first letter suggested by @ PM2Ring:
The best proposed solution for the first character only
bash-3.2$ var="it an öyster life"
bash-3.2$ python -c "import sys;print sys.argv[1].decode('utf8').capitalize()" "$var"
It an öyster life
The following solutions try to make up for all the first characters of words in a string:
:
bash-3.2$ python -c "print raw_input().decode('utf-8').title()" <<<"it an öyster life"
It An Öyster Life
:
bash-3.2$ var='dog is dog'
bash-3.2$ python -c "print raw_input().decode('utf-8').title()" <<<"$var"
Dog Is Dog
( ), , Python OSX 2.7.
1: ( @john1024 @dev-null)
.
,
var="it a dog life"
bash-3.2$ python -c "print '$var'.title()"
It A Dog Life
, : var="hello ''' world"
2: ( @mklement0)
Unicode
bash-3.2$ var='öyster'
bash-3.2$ python -c "print '$var'.title()"
öYster
, , ascii, title , Python2.
Unicode:
bash-3.2$ var='öyster'
python -c "print '$var'.decode('utf-8').title()"
Öyster
, , , , :
python -c "print raw_input().decode('utf-8').title()" <<<"it an öyster life"