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 ...
- 05-04-2010 #1Just 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.
- 05-04-2010 #2Just 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?
- 05-06-2010 #3Linux Guru
- 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!


Reply With Quote