ls - HP UX

This is a discussion on ls - HP UX ; Hi I'm total new in hpux. I have some scripts that works fine in linux. I use "ls -v" on linux that sorting my files with numbers (1,2,3,4,5,6,7,8,9,10,11, etc). Is there any command in hpux (10.20) that do the same ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: ls

  1. ls

    Hi I'm total new in hpux. I have some scripts that works fine in linux.
    I use "ls -v" on linux that sorting my files with numbers
    (1,2,3,4,5,6,7,8,9,10,11, etc). Is there any command in hpux (10.20)
    that do the same ?

    //Regards Bartosz Cichowicz

  2. Re: ls

    parun wrote:
    > I have some scripts that works fine in linux.
    > I use "ls -v" on linux that sorting my files with numbers
    > (1,2,3,4,5,6,7,8,9,10,11, etc). Is there any command in hpux (10.20)
    > that do the same?


    The Linux man page says sort by version. This is meaningless on HP-UX.
    What does it mean to you?

  3. Re: ls

    Dennis Handly writes:

    > parun wrote:
    >> I have some scripts that works fine in linux. I use "ls -v" on linux that
    >> sorting my files with numbers (1,2,3,4,5,6,7,8,9,10,11, etc). Is there any
    >> command in hpux (10.20) that do the same?

    >
    > The Linux man page says sort by version. This is meaningless on HP-UX.
    > What does it mean to you?


    The Info Page says (File: coreutils.info, Node: More details about version
    sort):

    10.1.4 More details about version sort
    --------------------------------------

    The version sort takes into account the fact that file names frequently
    include indices or version numbers. Standard sorting functions usually
    do not produce the ordering that people expect because comparisons are
    made on a character-by-character basis. The version sort addresses
    this problem, and is especially useful when browsing directories that
    contain many files with indices/version numbers in their names:

    $ ls -1 $ ls -1v
    foo.zml-1.gz foo.zml-1.gz
    foo.zml-100.gz foo.zml-2.gz
    foo.zml-12.gz foo.zml-6.gz
    foo.zml-13.gz foo.zml-12.gz
    foo.zml-2.gz foo.zml-13.gz
    foo.zml-25.gz foo.zml-25.gz
    foo.zml-6.gz foo.zml-100.gz

    Note also that numeric parts with leading zeros are considered as
    fractional one:

    $ ls -1 $ ls -1v
    abc-1.007.tgz abc-1.007.tgz
    abc-1.012b.tgz abc-1.01a.tgz
    abc-1.01a.tgz abc-1.012b.tgz

    This functionality is implemented using the `strverscmp' function.
    *Note String/Array Comparison: (libc)String/Array Comparison. One
    result of that implementation decision is that `ls -v' does not use the
    locale category, `LC_COLLATE'. As a result, non-numeric prefixes are
    sorted as if `LC_COLLATE' were set to `C'.

    [Maybe everyone knows what -v is now]

    Ulrich

  4. Re: ls

    This option "-v" does not exist in the native HP-UX ls command but can
    be found in the GNU version. This GNU ls command is packaged with
    other basic commands as "coreutils". See http://www.gnu.org/software/coreutils
    for more details.
    From the HPUX porting site (http://hpux.cs.utah.edu/hppd/cgi-bin/
    search?package=on&description=on&term=coreutils) you can get a
    compiled version of coreutils for HP-UX 11i (v1, v2 and v3) but
    unfortunately not for 10.20. You may try to request a compiled version
    for HP-UX 10.20 though

+ Reply to Thread