lower case to upper case string conversion in shell script | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

lower case to upper case string conversion in shell script

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 05-28-2002
dchalavadi dchalavadi is offline
Registered User
 
Join Date: May 2002
Last Activity: 29 May 2002, 9:55 AM EDT
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
lower case to upper case string conversion in shell script

How can convert a Lower case variable value to an upper case in the kron shell script.
Sponsored Links
    #2  
Old 05-28-2002
thehoghunter
Guest
 
Posts: n/a
Check the man page for the tr command - you can use it to change a variable also.

The next example translates all lower-case characters in
file1 to upper-case and writes the results to standard
output.

tr "[:lower:]" "[:upper:]" <file1
Sponsored Links
    #3  
Old 05-28-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon (Administrator Emeritus)
 
Join Date: Aug 2001
Last Activity: 23 July 2014, 9:48 AM EDT
Location: Ashburn, Virginia
Posts: 9,894
Thanks: 56
Thanked 413 Times in 248 Posts
With the korn shell, you can use typeset to make the shell do this without a separate process:

typeset -u two
one="something"
two=$one
echo $one $two

Anything stored in the variable "two" will be changed to upper case.
    #4  
Old 05-29-2002
witt
Guest
 
Posts: n/a
You can use the "dd" command too :

dd if=original_file of=new_file conv=ucase

I hope help you

Witt
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Conversion from Upper Case to Lower Case Condition based tsbiju Shell Programming and Scripting 12 07-08-2011 02:53 PM
[Solved] Change Upper case to Lower case in C shell rockytodd Shell Programming and Scripting 3 11-04-2010 12:57 PM
data array needs to change upper case to lower case usustarr Shell Programming and Scripting 8 04-16-2010 05:33 PM
Script to Convert Upper case to Lower case grahambo2005 Shell Programming and Scripting 7 07-12-2009 09:15 AM
how to convert value in a variable from upper case to lower case manmeet Shell Programming and Scripting 2 11-13-2008 01:22 PM



All times are GMT -4. The time now is 01:54 PM.