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!

setting a variable to translated (to upper) argument

Status
Not open for further replies.

glpinkston

Programmer
May 14, 2003
3
US
A previous thread on tranlating cases was helpful, but I need help assigning the tranlated string input argument to a variable (in csh).
The script line:
echo $argv[1] | tr '[:lower:]' '[:upper:]' works fine and displays the argument in uppercase.
The script line:
set orderby = $argv[1] | tr '[:lower:]' '[:upper:]'
assigns the argument to the variable, but still in lowercase.
How do I convert the argument to uppercase and assign it to the vareable?
 
try
typeset -u orderby
This should automatically assign to uppercase when you do:
orderby = $argv[1]


Dickie Bird (:)-)))
 
set foo=`echo "foo" | tr '[:lower:]' '[:upper:]'`
echo $foo

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Thanks Vlad & Dickie for your input.
I found that
set orderby = `echo $argv[1] | tr '[:lower:]' '[:upper:]'`
also works.

glpinkston
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top