Find the answer to your Linux question:
Results 1 to 3 of 3
Guys, We switched from unix to linux and we have an old report that extracted data from a database, output to an ascii file and then sorted the results in ...
  1. #1
    Just Joined!
    Join Date
    May 2010
    Posts
    2

    Linux SORT command versus Unix SORT

    Guys,

    We switched from unix to linux and we have an old report that extracted data from a database, output to an ascii file and then sorted the results in the file based on different arguments.

    The report now blows up when it runs, and I can only guess it is because the options for sort on linux differ slightly from unix.

    For example, here is one of the commands issued from within the report app that ran on the old unix box:

    if sort-sequence = "descending" then
    'sort -t~\" -f +3.0f -4.0 +5.0r -6.0 -f '
    else
    'sort -t~\" +3.0f -4.0 +1.0f -2.0 -f'

    I will eventually rewrite the report to store the data in a local table, but hoping I can simply adjust the options to suit the requirments of linux.

    Basically, I need to know if this can be a quick fix for the short term.

    Thanks.

  2. #2
    Just Joined!
    Join Date
    May 2010
    Posts
    2

    More Info ...

    Guys,

    Here's some better information:

    The following works on the old unix box, but not the new linux box:

    sort -t ' ' +1.0 +1.10 -f pastdue.dat > pastduesort.dat

    If I run the above from a linux command prompt, I get the following error:
    sort: open failed: +1.0: No such file or directory

    It appears to be the apostrophe-space-apostrophe after the -t option. I am wondering what linux is expecting instead?

  3. #3
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Read the manpage for sort?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...