Re: problem wth sort utility?



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



Relevant Pages

  • Re: Reincarnation Inquiry
    ... were any species of snake in Ireland so that it was a sort of Christian ... called 'Anita' that I lengthen in my mind into 'Amanita Muscaria' because it ... case, in terms of us and it, which implies a possible threat, fear, ... suicide, it seems that everybody who commits suicide was suffering from ...
    (talk.religion.buddhism)
  • Re: Fear Was: What is your Weapon of Choice
    ... but it sort of got in my head. ... answer the door? ...  The answer is fear. ... Everybody should take refresher courses in CPR if they havn't had to ...
    (misc.news.internet.discuss)
  • Re: OT - BoB
    ... I had a feeling someone would ask. ... I will describe the _sort_ of thing I mean: ... However, I had the feeling when I saw it - and yes, I'm pretty certain I have seen this activity - that in the case of at least _some_ of the participants, the idea had gained an unstoppable momentum, but that nobody would dare to say anything against it for fear of being thought discriminatory. ... Someone might be so gung-ho on helping someone to do something, overcoming all obstacles, that they may lose sight of whether the person actually wants to do whatever it is - especially if the person did initially express some interest, but genuinely changes their mind. ...
    (uk.media.radio.archers)
  • Re: I dont feel depressed anymore
    ... I've had all sorts of drugs prescribed to try to help with the fear I ... What sort of drugs? ... and the beta blocker slowed down my ability to see what I was looking ...
    (uk.people.support.depression)
  • Re: lean men and house-thatchers
    ... > Yond Cassius has a lean and hungry look; ... But I fear him not: ... > Seldom he smiles; and smiles in such a sort ...
    (sci.lang.translation)