![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| only uppercase first character? | fedora | Shell Programming and Scripting | 7 | 09-26-2008 08:12 PM |
| Need to change filenames in a particular directory from lowercase to UPPERCASE | Duke_Lukem | UNIX for Dummies Questions & Answers | 7 | 01-07-2008 06:32 PM |
| How convert lowercase or uppercase | Alex20 | Shell Programming and Scripting | 5 | 03-07-2005 07:07 AM |
| Converting to Uppercase | dreams5617 | Shell Programming and Scripting | 3 | 11-12-2004 01:44 AM |
| uppercase to lowercase | webex | Shell Programming and Scripting | 4 | 01-03-2002 02:15 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Lowercase to Uppercase
Inside a script I have 2 variables COMP=cy and PT=t. further down the same script I require at the same line to call those 2 variables the first time uppercase and after lowercase ${COMP}${PT}ACE,${COMP}${PT}ace. Can somebody help me
Thanks in advance George Govotsis |
|
||||
|
There are a variety of ways to do what you suggest. The simplest is to create variables that the shell will convert to all uppercase or lowercase:
Code:
typeset -u COMP_UPPER PT_UPPER typeset -l COMP_LOWER PT_LOWER Code:
echo "$COMP" | tr '[a-z]' '[A-Z]'
echo "$COMP" | awk '{print toupper($0)}'
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|