I'm working on a heavily-used (in our system) wrapper around /bin/sort. A
file to be sorted,
key positions, and other sort parameters are passed into this routine, and
then /bin/sort is
system()'ed with the parameters. Because the sort routine has no
information about the
actual contents of the file (whitespace, specifically), keys are defined in
terms of column positions,
and then /bin/sort is forced to treat the entire line as one field with the
sort "-t\\\n" +0.0 -0.72 ...
On SunOS 5.5.1, this fails with the message: "sort: option requires an
argument -- t". This
particular routine has worked on Irix.
1) How can I portably define sort keys in terms of column positions, not
field positions? Or,
equivalently, how can I indicate that sort should use the entire line as one
field, not whitespace
2) The "-t\\\n" syntax seems correct to me. Is there a better solution?
I'd very much appreciate any tips.