LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 05-02-2005, 05:34 PM   #1
Maldain
Member
 
Registered: Jan 2005
Posts: 112

Rep: Reputation: 15
help changing case on arguments to bourne shell script


I have a shell script that I need to modify to make call another script with the arguments passed to the original script. The problem is the argument passed is going to be upper case and I need it to be lower case.

Is there a clean and easy way to pass the argument in lower case? Or do I have to dump it to a file with the rest of the program call and translate the argument?

I'm open to any suggestions on this little bit of code.

Thanks
M. Lacy
Western Tool Supply
 
Old 05-02-2005, 05:36 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
Code:
echo lowercase: $TERM uppercase: $(echo $TERM | tr 'a-z' 'A-Z')
lowercase: xterm uppercase: XTERM
 
Old 05-03-2005, 11:18 AM   #3
Maldain
Member
 
Registered: Jan 2005
Posts: 112

Original Poster
Rep: Reputation: 15
Thanks a heap. This was making me nuts.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with basic bourne shell script rnj Programming 6 09-13-2005 09:41 PM
Passing arguments to a shell script subu_s Programming 3 09-02-2005 06:13 AM
change case of a string (TOUPPER) in shell script raees Linux - Software 3 05-03-2005 03:13 PM
Apache passing arguments to a shell script disabled? mikeyt_333 Linux - Security 3 08-03-2004 07:09 PM
if statements and case statements not working in bourne shell script mparkhurs Programming 3 06-12-2004 03:41 AM


All times are GMT -5. The time now is 07:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration