ls behavior ??? - Unix

This is a discussion on ls behavior ??? - Unix ; Hello, I have an issue with the way ls displays files in sparc Solaris 8,9,10 On console, ls display order is: Alpha alpha.5 bambi list_05_sclk.tdl alpha alpha_05 Bravo sulley alpha. alpha_1 bravo alpha.05 alpha_5 list_05.tdl If I login remotely via ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: ls behavior ???

  1. ls behavior ???

    Hello,
    I have an issue with the way ls displays files in sparc Solaris 8,9,10

    On console, ls display order is:
    Alpha alpha.5 bambi list_05_sclk.tdl
    alpha alpha_05 Bravo sulley
    alpha. alpha_1 bravo
    alpha.05 alpha_5 list_05.tdl

    If I login remotely via ssh(to the same machine), the ls output is:
    Alpha alpha.05 alpha_5 list_05_sclk.tdl
    Bravo alpha.5 bambi sulley
    alpha alpha_05 bravo
    alpha. alpha_1 list_05.tdl

    Any ideas why the output is different? How can I change this so both
    behave the same?

    ls is not aliased
    openssh-3.7.1p1

    Thanks for the help!

  2. Re: ls behavior ???

    On 2006-03-29, Mike wrote:
    > Hello,
    > I have an issue with the way ls displays files in sparc Solaris 8,9,10
    >
    > On console, ls display order is:
    > Alpha alpha.5 bambi list_05_sclk.tdl
    > alpha alpha_05 Bravo sulley
    > alpha. alpha_1 bravo
    > alpha.05 alpha_5 list_05.tdl
    >
    > If I login remotely via ssh(to the same machine), the ls output is:
    > Alpha alpha.05 alpha_5 list_05_sclk.tdl
    > Bravo alpha.5 bambi sulley
    > alpha alpha_05 bravo
    > alpha. alpha_1 list_05.tdl
    >
    > Any ideas why the output is different? How can I change this so both
    > behave the same?


    Your locale settings are different. To see what they are, use:

    printf "%s\n" "$LC_COLLATE" "$LC_ALL"

    Then set LC_COLLATE to the value you prefer.

    --
    Chris F.A. Johnson, author |
    Shell Scripting Recipes: | My code in this post, if any,
    A Problem-Solution Approach | is released under the
    2005, Apress | GNU General Public Licence

  3. Re: ls behavior ???

    On 2006-03-29, Mike wrote:
    > Hello,
    > I have an issue with the way ls displays files in sparc Solaris 8,9,10
    >
    > On console, ls display order is:
    > Alpha alpha.5 bambi list_05_sclk.tdl
    > alpha alpha_05 Bravo sulley
    > alpha. alpha_1 bravo
    > alpha.05 alpha_5 list_05.tdl
    >
    > If I login remotely via ssh(to the same machine), the ls output is:
    > Alpha alpha.05 alpha_5 list_05_sclk.tdl
    > Bravo alpha.5 bambi sulley
    > alpha alpha_05 bravo
    > alpha. alpha_1 list_05.tdl
    >
    > Any ideas why the output is different? How can I change this so both
    > behave the same?


    What is the output of "locale" in both situations?

  4. Re: ls behavior ???

    Thanks!!! I don't think I could have figured that out. How did you know
    to look at that? What is LC_COLLATE for?

    At console; LC_COLLATE = en_US.ISO8859-1

    in the ssh session, LC_COLLATE was not set. Once I set it, the ls
    results were the same. Thanks for the answer!

    Oh, how can I automatically set it for the SSH session ?


    Chris F.A. Johnson wrote:
    > On 2006-03-29, Mike wrote:
    >
    >>Hello,
    >>I have an issue with the way ls displays files in sparc Solaris 8,9,10
    >>
    >>On console, ls display order is:
    >>Alpha alpha.5 bambi list_05_sclk.tdl
    >>alpha alpha_05 Bravo sulley
    >>alpha. alpha_1 bravo
    >>alpha.05 alpha_5 list_05.tdl
    >>
    >>If I login remotely via ssh(to the same machine), the ls output is:
    >>Alpha alpha.05 alpha_5 list_05_sclk.tdl
    >>Bravo alpha.5 bambi sulley
    >>alpha alpha_05 bravo
    >>alpha. alpha_1 list_05.tdl
    >>
    >>Any ideas why the output is different? How can I change this so both
    >>behave the same?

    >
    >
    > Your locale settings are different. To see what they are, use:
    >
    > printf "%s\n" "$LC_COLLATE" "$LC_ALL"
    >
    > Then set LC_COLLATE to the value you prefer.
    >


  5. Re: ls behavior ???

    Mike wrote:
    > Thanks!!! I don't think I could have figured that out. How did you know
    > to look at that? What is LC_COLLATE for?

    I looked it up. Sorry about being lazy.
    >
    > At console; LC_COLLATE = en_US.ISO8859-1
    >
    > in the ssh session, LC_COLLATE was not set. Once I set it, the ls
    > results were the same. Thanks for the answer!
    >
    > Oh, how can I automatically set it for the SSH session ?

    I just added 'setenv LC_COLLATE en...' to .cshrc
    >

    Thanks again!!!
    >
    > Chris F.A. Johnson wrote:
    >
    >> On 2006-03-29, Mike wrote:
    >>
    >>> Hello,
    >>> I have an issue with the way ls displays files in sparc Solaris 8,9,10
    >>>
    >>> On console, ls display order is:
    >>> Alpha alpha.5 bambi list_05_sclk.tdl
    >>> alpha alpha_05 Bravo sulley
    >>> alpha. alpha_1 bravo
    >>> alpha.05 alpha_5 list_05.tdl
    >>>
    >>> If I login remotely via ssh(to the same machine), the ls output is:
    >>> Alpha alpha.05 alpha_5 list_05_sclk.tdl
    >>> Bravo alpha.5 bambi sulley
    >>> alpha alpha_05 bravo
    >>> alpha. alpha_1 list_05.tdl
    >>>
    >>> Any ideas why the output is different? How can I change this so both
    >>> behave the same?

    >>
    >>
    >>
    >> Your locale settings are different. To see what they are, use:
    >>
    >> printf "%s\n" "$LC_COLLATE" "$LC_ALL"
    >>
    >> Then set LC_COLLATE to the value you prefer.
    >>


  6. Re: ls behavior ???

    Mike wrote:
    >
    > > Oh, how can I automatically set it for the SSH session ?

    > I just added 'setenv LC_COLLATE en...' to .cshrc


    Ooo, an oldie still using csh. I thought I was a dinosaur
    for still using csh after year 2000. I finally left technological
    progress catch me up only a few years ago and have
    been using ksh or bash recently.


  7. Re: ls behavior ???

    In article ,
    Mike wrote:

    > Thanks!!! I don't think I could have figured that out. How did you know
    > to look at that? What is LC_COLLATE for?


    "collate" is another word for "sort", and it controls the ordering of
    characters. So any time you notice things that should be alphabetical
    coming out in different orders, it's almost always because you're using
    a different collate setting.

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    *** PLEASE don't copy me on replies, I'll read them in the group ***

  8. Re: ls behavior ???

    Doug Freyburger wrote:
    > Mike wrote:
    >
    >>>Oh, how can I automatically set it for the SSH session ?

    >>
    >>I just added 'setenv LC_COLLATE en...' to .cshrc

    >
    >
    > Ooo, an oldie still using csh. I thought I was a dinosaur
    > for still using csh after year 2000. I finally left technological
    > progress catch me up only a few years ago and have
    > been using ksh or bash recently.
    >

    Well, not quite that old. I am using tcsh. AFAIK, it is very similar
    to bash (line editing, up arrows).

  9. Re: ls behavior ???

    Mike writes:

    > Well, not quite that old. I am using tcsh. AFAIK, it is very similar
    > to bash (line editing, up arrows).


    You're not alone.

    http://www.killfile.org/~tskirvin/uberconfig/csh/

    - Tim Skirvin (tskirvin@killfile.org)
    --
    http://www.killfile.org/~tskirvin/ Skirv's Homepage < <*>
    http://www.killfile.org/~tskirvin/history/ Skirv's History

+ Reply to Thread