HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: sort - lowercase all
Operating System - HP-UX
1831703
Members
2594
Online
110029
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
11-29-2005 11:36 PM
11-29-2005 11:36 PM
sort - lowercase all
I want to do a sort on a couple of files. How do I specify it to ignore the case, or change all of them to lower case?
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2005 11:45 PM
11-29-2005 11:45 PM
Re: sort - lowercase all
Hi :
First, if you really only want the conversion of case for sorting upper and lower case values to be the same, use the '-f' switch of sort. This "folds" letters, converting all lowercase to uppercase prior to conversion. The actual data is not changed. I would think that this is really what you want.
If you truly want to convert the file to lowercase letters you could do:
# sort file |tr -s [[:upper:]] [[:lower:]]
Regards!
...JRF...
First, if you really only want the conversion of case for sorting upper and lower case values to be the same, use the '-f' switch of sort. This "folds" letters, converting all lowercase to uppercase prior to conversion. The actual data is not changed. I would think that this is really what you want.
If you truly want to convert the file to lowercase letters you could do:
# sort file |tr -s [[:upper:]] [[:lower:]]
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2005 11:47 PM
11-29-2005 11:47 PM
Re: sort - lowercase all
# sort -f ....
-f: fold (ignore case in sort order)
Enjoy, Have FUN! H.Merijn
-f: fold (ignore case in sort order)
Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2005 08:01 AM
11-30-2005 08:01 AM
Re: sort - lowercase all
The one-liner below will lowercase the files before sorting them i.e. if I understand your question.
# awk '{print tolower($0)}' file1 file2 | sort
# awk '{print tolower($0)}' file1 file2 | sort
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP