change character case


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers change character case
# 1  
Old 03-23-2006
change character case

i need to change character case inside a script file. How i can do that?

any fucntion?

thanks
# 2  
Old 03-23-2006
Korn shell provides typeset -l and typeset -u
# 3  
Old 03-23-2006
or.
Code:
 echo "value" | tr -s '[:lower:]' '[:upper:]'

# 4  
Old 03-23-2006
"tr" behaves stragely sometimes with certain locale settings, which is why I personally avoid using it.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Change first letter of a word from lower case to upper case

Hi all, I am trying to find a way to change first letter in a word from lower case to upper case. It should be done for each first word in text or in paragraph, and also for each word after punctuation like . ; : ! ?I found the following command sed -i 's/\s*./\U&\E/g' $@ filenamebut... (7 Replies)
Discussion started by: georgi58
7 Replies

2. UNIX for Dummies Questions & Answers

Change lowercase to upper case

dear all, i have file input ABCDE_Asta_Key_Park,COJ050,10.142.3.150 C_BDEFG_City_Lake,C_BIR0,10.135.3.6 C_FDGEBIR_Axaudia,C_ABIR1,10.135.3.34 I want to change lowercase in to uppercase for all strings output ABCDE_ASTA_KEY_PARK,COJ050,10.142.3.150 C_BDEFG_CITY_LAKE,C_BIR0,10.135.3.6... (5 Replies)
Discussion started by: radius
5 Replies

3. Shell Programming and Scripting

Need help to change tokenized string case

I'm trying to change the string cases for a particular column, but can't figure how do to it with sed. Example: Strings (space as delimiter): write group MYGROUP MySpecialGroup /local/users/mygroup write group HISGROUP HisSpecialGroup /local/users/hisgroup write group HerGroup... (3 Replies)
Discussion started by: fluffy_ko
3 Replies

4. Shell Programming and Scripting

Change case preserving the same case

how can i do a case insensitive search/replace but keep the same case? e.g., i want to change a word like apple-pie to orange-cake but for the first word if the first letter of the keyword or the letter after the - is capitalised i want to preserve that e.g., if the before is: ... (5 Replies)
Discussion started by: vanessafan99
5 Replies

5. Shell Programming and Scripting

[Solved] Change Upper case to Lower case in C shell

Is there a command that can switch a character variable from UPPER case to lower case? like foreach AC ( ABC BCD PLL QIO) set ac `COMMAND($AC)` ... end Thanks a lot! (3 Replies)
Discussion started by: rockytodd
3 Replies

6. Shell Programming and Scripting

data array needs to change upper case to lower case

Hi all, i have a data array as followes. ARRAY=DFSG345GGG ARRAY=234FDFG090 ARRAY=VDFVGBGHH so on.......... i need all english letters to be change to lower case. So i am expecting to see ARRAY=dfsg345ggg ARRAY=234fdfg090 ARRAY=vdfvgbghh so on........ If i have to copy this data in... (8 Replies)
Discussion started by: usustarr
8 Replies

7. UNIX for Dummies Questions & Answers

Change case of single character in pattern

Using UNIX tools, but not using GAWK (NAWK is OK), is there a more elegant way to achieve this: sed ' s/_a/_A/1 s/_b/_B/1 s/_c/_C/1 rest of alpahabet ' I want to change the case of a single character in each string of a text file. The character will be matched by regex '_' and only... (2 Replies)
Discussion started by: uiop44
2 Replies

8. Shell Programming and Scripting

Convert first character of each word to upper case

Hi, Is there any function(Bash) out there that can convert the first character of each word to upper case?... (3 Replies)
Discussion started by: harchew
3 Replies

9. Shell Programming and Scripting

How do I ignore one character in a case statement? PLEASE HELP!

Hello, I am new to this forums. I need help with shell, and ksh in particular. I have a case statement that does something if -k. So it looks like: case $arg in -k) PUT=y, SEND=1 Thats all good and dandy. But now I want to change it where whether or not the user puts -k or not, it will do... (2 Replies)
Discussion started by: cpunisher
2 Replies

10. Shell Programming and Scripting

change filenames to Proper case

Hi, I have files with all its characters in lower cases. I need to change them to "proper case" (starting char to be come Upper case). How can I? Pls suggest. for e.g. xyz.txt should become Xyz.txt TIA Prvn (7 Replies)
Discussion started by: prvnrk
7 Replies
Login or Register to Ask a Question