Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you capitilize in ksh scripts

Status
Not open for further replies.

hronek

MIS
Nov 1, 2001
14
US
I am trying to capitilize a string in a ksh script and can not figure out how to do so. Can anyone help me?

Thank you,
Steven Hronek

 
A friend just figured it out This is an example.

> LSTR=abc;CSTR=`echo $LSTR | tr '[:lower:]' '[:upper:]' `;echo $CSTR
>ABC
 
An easier way is to typeset your variable. In ksh:

typeset -u VAR
VAR=test
echo $VAR

produces the output "TEST"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top