[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with command sort after uniq -c

From: Bauke Jan Douma
Subject: Re: problem with command sort after uniq -c
Date: Mon, 10 Mar 2008 20:43:10 +0100
User-agent: Thunderbird (X11/20080213)

Andreas Schwab wrote on 10-03-08 19:54:
Damien ANCELIN <address@hidden> writes:

I met a problem with the sort command : I've used the uniq command with
the -c option to count some numbers, and then applying sort -n don't sort
lines by numeric order of the first field.
Here is an example (my sort version is 5.97) :
$ cat bug_sort | sort -n

This is a useless use of cat, you can just redirect sort's standard
input from the file.

True, but such constructs do happen.

What might have been the case here, and which is a
situation that I find myself in sometimes, is this:
you want to do 'filter1 FILE | filter2'
(or 'filter1 <FILE | filter2').  Somehow the output
isn't what's to be expected.  You investigate, and
part of that is temporarily substituting filter1 for
plain cat and the command becomes 'cat FILE | filter2'.

Most of the time this is on the command-line.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]