bug-coreutils
[Top][All Lists]
Advanced

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

Re: its not a bug, its limitation


From: Eric Blake
Subject: Re: its not a bug, its limitation
Date: Tue, 01 May 2007 06:43:43 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Please keep replies on the list, so that others may chime in with
solutions, and so that others may reference the archives for the answers
you are given.

According to OBLus on 5/1/2007 3:29 AM:
> hi                         2007-05-01
> 
>> Consider upgrading.  Textutils was joined with coreutils, and the latest
>> stable version is now 6.9; based on the obsolete mail address you chose,
>> your version is quite obsolete.
> 
> I have been mistaken, I have coreutils 5.97-5.3 in Testing Release of
> Debian...
> 
>> According to OBLus on 4/29/2007 4:58 PM:
>>> hi                         2007-04-30
>>>
>>> in textutils package program called "join" should have -sort option
>>> which could sort (ASC or DESC) both fields -1 1 -1 2 before two files
>>> will be compared...
> 
>> No, in Unix philosophy, it is better to have small programs that do one
>> thing well, then to have one program that does lots of things but nothing
>> well.  Since the 'sort' utility exists, and is also part of coreutils, and
>> can sort ascending or descending on the first two fields of a given file,
>> it doesn't make much sense to add sorting capabilities into the 'join'
>> utility unless you can prove that the efficiency gain and non-portable
>> extension outweigh the maintenance burden.
> 
> well i have two similar files which are delimited by : but i cant
> change them and wanto join them by fields...
> but i cant use other fields from this files to compare them beacouse
> this fields are not sorted... so i thing there could be an option in
> "join" which can use "sort" program from coreutils to sort this files
> before compare "on the fly"...
> but maybe Im wrong..

If you use bash, there are non-portable extensions such as:

join -options... <(sort -options... file1) <(sort -options... file2)

that make it very easy to sort two files then join the results using
process substitution.

But even sticking to portable tools, you can always use temporary files,
or perhaps this is an instance where an awk script is the way to go.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGNzX/84KuGfSFAYARAtNmAJwM7CEg0MqV6lytyK9Nwo1FjSsWPQCfZ4yf
qr3mO3mTsoa9oagp3hZbhmY=
=6RbZ
-----END PGP SIGNATURE-----




reply via email to

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