LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-25-2015, 10:27 PM   #16
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,409

Rep: Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775Reputation: 2775

There is a standard for Unicode collation. http://www.unicode.org/reports/tr10/

For what you want, perhaps 'LC_COLLATE=C; ls -1 | sort --ignore-case' would suit.
 
1 members found this post helpful.
Old 04-26-2015, 02:59 AM   #17
centguy
Member
 
Registered: Feb 2008
Posts: 635

Original Poster
Blog Entries: 1

Rep: Reputation: 48
allend: I like your suggestion --- very specific rather a vague suggestion. It is much closer to what I dreamt of.

Quote:

$ export LC_COLLATE=C; /bin/ls -1 | sort --ignore-case
07--Sb
07-Sb
07ASb
07SSb
A-
a--Sb
a-Sb
AA
aASb
AS
aSSb
B--
B-A
B-B
C--A
C-AA
C-ZA
Z--Sb
Z-Sb
ZASb
ZSSb
"a" and "A" mix freely, since the cases have been ignored. How nice is an X where LC_COLLATE=X that will do exact what I want. I will check briefly
the site you suggested.

Thanks a lot!
 
Old 04-26-2015, 03:42 AM   #18
centguy
Member
 
Registered: Feb 2008
Posts: 635

Original Poster
Blog Entries: 1

Rep: Reputation: 48
On second thought, sort --ignore-case is really probably want I need. The idea is very simple, I have almost never mix
(>99%?) upper and lower cases. For example, I will have Project-A, Project-B

or project-A, project-B, but

not

project-A, project-b,

or

Project-A, project-B.



The only exception I can think of is

one consistent set of

Project-specialAA, Project-specialBB, Project-specialCC,

and mix with

another consistent set of

Project-SpecialABC, Project-SpecialEFG, Project-SpecialHIJ,

Well, if this rare case happens, I just need to rename the files OR to use two directories.
Perfect yet easy solution is hard to come by.
 
Old 04-30-2015, 07:48 AM   #19
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
You need to take the semicolon out. With the semicolon you have two commands, thus requiring the export to get the LC_COLLATE to be passed to the ls command.

"LC_COLLATE=C ls -1" will export LC_COLLATE=C to only one process - the ls.
 
  


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
Writing a file character by character with a bash builtin command (script). stf92 Linux - Newbie 4 06-30-2012 08:41 PM
Find and Replace character/special character from the file MyRelam Red Hat 8 05-21-2012 12:52 AM
Bash scripting: parsing a text file character-by-character Completely Clueless Programming 13 08-12-2009 09:07 AM
To know the function on checking whether a character is ascii or unicode character. murugesan Programming 2 01-23-2009 01:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:42 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
Open Source Consulting | Domain Registration