Console utility for capitalising/initialising words in string - for bash script?
Posted on 2004-11-28
I'm trying to do a translation to a text string in a bash script, to initialise each word in a string (so we're talking console standard input/output here).
I found the 'tr' utility and tried a few things including:
echo "Simon briggs" | tr ' a-z' ' A-Z' *note the spaces*
produces "SIMON BRIGGS", when I really want "Simon Briggs"...
so it only appears to work on characters individually, when I want to check for a 'pair' of characters. This should hopefully explain what I mean at least.
Anyone have advice on a more suitable util - and perhaps some hints on the syntax required for it?