Convert 'a' to 'A' in a Shell-Script

Eoin Woods ewoods at hemel.bull.co.uk
Thu Jan 31 04:29:52 AEST 1991


koe at kivax.UUCP (Diana Koehler) writes:

>How can I convert "lowercase" characters in "uppercase" characters
>in a Shell-Script.
>f.e. convert all 'a' to 'A' ?
>(awk, sed ??)

Try tr(1), for example :

abc='Hello'
def=`echo $abc | tr [a-z][A-Z]`
echo $def

Will produce :

HELLO

Eoin.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~    Eoin Woods, Software Development Group, Bull HN Information Systems,   ~
~                Maxted Road, Hemel Hempstead, Herts HP2 7DZ, UK.           ~
~                Tel : +44 442 232222 x4823   Fax : +44 442 234084          ~
~      < Eoin.Woods at hemel.bull.co.uk  or   ...!uunet!ukc!brno!ewoods>       ~
~          < When do we start news group comp.os.emacs ?  :-) >             ~



More information about the Comp.unix.questions mailing list