www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/14/03:26:00

Date: Tue, 14 Jul 1998 10:25:49 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Peter J. Farley III" <pjfarley AT banet DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: sort -u problem/question
In-Reply-To: <35aab37b.8000330@news1.banet.net>
Message-ID: <Pine.SUN.3.91.980714102531.6831N-100000@is>
MIME-Version: 1.0

On Tue, 14 Jul 1998, Peter J. Farley III wrote:

> I'm trying to use the DJGPP port of GNU sort with the "-u" option to
> eliminate all but one equal-key record.  However, all I ever get is a
> single record output, the first record in the file.
> 
> Is this a known problem with the DJGPP port, or am I not using sort
> correctly?

The latter.

> C:\stest>sort +2 +5 -t \t -u sortuniq.tst
> field1  field2  field3 9 field3 field4  field5  field6/9        field7

Who said that `sort' understands \t as a TAB?  This would probably
work in a Unix shell, since the shell itself converts \t to a TAB, but
DOS shells don't do that.  You need to actually press a TAB (and
enclose it in quotes) to make this work.  When I did that, your
example worked for me.

Btw, I don't even understand why did you need to use the -t switch:
TAB is considered a field separator by default, since it is a
whitespace character (see the `sort' docs).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019