- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Changing a string to lower cases in korn shell...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2003 02:07 AM
тАО04-16-2003 02:07 AM
I want to change the value stored in a string variable to all lower case.
For instance :
VAR1=AbcD then I want this variable becomes :
VAR1=abcd
How can I do that ?
Thanks in advance for your help.
Laurent MENEGUZY
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2003 02:12 AM
тАО04-16-2003 02:12 AM
Re: Changing a string to lower cases in korn shell script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2003 02:13 AM
тАО04-16-2003 02:13 AM
Re: Changing a string to lower cases in korn shell script
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2003 02:14 AM
тАО04-16-2003 02:14 AM
Re: Changing a string to lower cases in korn shell script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2003 02:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2003 02:17 AM
тАО04-16-2003 02:17 AM
Re: Changing a string to lower cases in korn shell script
Varable | tr -s "[A-Z]" "[a-z]"
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2003 02:29 AM
тАО04-16-2003 02:29 AM
Re: Changing a string to lower cases in korn shell script
VAR1=`echo $VAR1 | tr -s "[A-Z]" "[a-z]"`
Be careful wit the quotation.
Frank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2003 02:38 AM
тАО04-16-2003 02:38 AM
Re: Changing a string to lower cases in korn shell script
typeset -l VAR2
VAR1=AbcD
VAR2="$VAR1"
echo $VAR1 $VAR2
AbcD abcd
When assigning strings, it's always a good idea to use double quotes so any imbedded spaces, etc, are preserved. The typeset attribute has more than a dozen formatting options such as UPPERCASE, lowewrcase, left/right justified, zero-fill, etc. typeset is available in POSIX shells such as the HP-UX POSIX shell and ksh as well as BASH.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-16-2003 04:17 AM
тАО04-16-2003 04:17 AM
Re: Changing a string to lower cases in korn shell script
Laurent MENEGUZY