Re: Problem with sort command

2009-11-02 Thread Philip Rowlands

On Mon, 2 Nov 2009, Justin White wrote:


I have been using the sort command for years with a syntax as follows:

cat $file | sort -t, +1


This is addressed in the FAQ:
http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Old-tail-plus-N-syntax-now-fails

In short, sort is treating "+1" as a filename. The behaviour changed due 
to conflicting versions of the relevant standard, and you should rewrite 
the sort command to use the unambiguous "+kN" format.



Cheers,
Phil




Problem with sort command

2009-11-02 Thread Justin White
I have been using the sort command for years with a syntax as follows:

cat $file | sort -t, +1

I create filesystems on Linux and AIX from a CSV file and sort by the second
column as shown above.

Recently I have tried this command on RHEL 5.1 and it fails.  So I went and
tried on Ubuntu 9.04 and also fails.

Is this a bug or has the syntax for this type of sorting by columns changed?

ubuntu 9.04 and RHEL 5.1 command:

cat a.csv
1,3,3,4
1,9,3,4
1,2,3,4

$ cat a.csv | sort -t, +1
sort: open failed: +1: No such file or directory

RHEL 4:

# cat a.csv
1,3,3,4
1,9,3,4
1,2,3,4

# cat a.csv | sort -t, +1
1,2,3,4
1,3,3,4
1,9,3,4

# cat /etc/redhat-release
Red Hat Enterprise Linux ES release 4 (Nahant Update 5)

Thanks for any help you can provide.

Justin