Re: problem wth sort utility?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01Jul2011 17:00, Michael D. Setzer II <mikes@xxxxxxxxxxxxxxxx> wrote:
| I'm getting results that I don't expect and different from busybox 
| sort?
[...]
| [sda3            ] [ext3       ] [<unknown>        ] [   434.38 GB] [  8] [  3] 
| [sda             ] [Hitachi HDP72505               ] [   465.76 GB] [  8] [  
| 
| Which is not what I expect with sda coming at the end instead of 
| before sda1, and there are just spaces between all the charcters, 
| no special codes.
| 
| Using busybox sort results in this. [...]
| [sda             ] [Hitachi HDP72505               ] [   465.76 GB] [  8] [  
| [sda1            ] [ext3       ] [<unknown>        ] [   200.00 MB] [  8] [  
[...]
| Which is what I expect?
| If I create a file with just the disk and partition info, both sorts give 
| me the correct sorts. Even if I put spaces afterwards it sorts fine, 
| but if I put non-blanks it puts the sda at the end?

1: Please show us your command line.
   I'm imagining something like:
     sort < filename

2: What tool are you using to create the file?
   It is possible you are using something other than a space or TAB in
   the Fedora file. There are Unicode codepoints for spaces in addition
   to the usual two (space:32, tab:9).

Both space and tab sort lexically before digits (which start at 48 for
"0"). If you're using another whitespace codepoint by accident then it
will probably come above the digits and thus change the sort result.

Cheers,
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

I must not fear.  Fear is the mind-killer.  Fear is the little death that
brings total obliteration.  I will face my fear.  I will permit it to pass
over me and through me.  And when it has gone past I will turn the inner eye
to see its path.  Where the fear has gone there will be nothing.  Only I will
remain.
        - Frank Herbert _Dune_
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux