On 08/09/10 11:35, Bernhard Schiffner wrote:
> Hi,
> 
> working with differnet versions of join I noticed something I consider a bug:
> 
> Multiple spaces from input  are reduced to only one in the output:
> 
> Try to join
> 25259f7a611bb258ddb2ee73dd83d22c
> with
> 25259f7a611bb258ddb2ee73dd83d22c  /O L D  ST U F F/Logo2.png
> 
> (Notice the _two_ spaces here: "..22c  /O..." and "..D  ST..")
> 
> The output is single spaced "D ST" 
> - in version 6.10 (as in Debian Lenny)
> - in recent git
> with two spaces "D  ST"
> - in version 7.1 (as in OpenSuse 11.2)
> 
> For the separator it seems ok, but for "data" it is IMHO not so good.)
> 
> Do you have any idea, how to solve / circumvent this?
> (Perhaps some magic with join -t ?)
> 
> TIA!
> 
> Bernhard
> 
> PS:
> (Opensuse 11.2):
> be...@bs7:~> join bbb malvers-groups-hash-dupes
> 25259f7a611bb258ddb2ee73dd83d22c  /O L D  ST U F F/Logo2.png
> 
> (recent git):
> be...@bs7:~> ./Dokumente/developing/coreutils/src/join bbb malvers-groups-
> hash-dupes
> 25259f7a611bb258ddb2ee73dd83d22c /O L D ST U F F/Logo2.png

It is interesting that suse is different
I tested solaris, FreeBSD, Fedora and git and they
all output a single space only, as follows:

$ join <(printf "c\n") <(printf "c  /1 s 2  s\n") | tr ' ' .
c./1.s.2.s

I.E. they split to fields first and output each field
individually, even if only the first field is used in the match.
One can get the behavior you want by specifying an explicit space:

$ join -t " " <(printf "c\n") <(printf "c  /1 s 2  s\n") | tr ' ' .
c../1.s.2..s

It's a bit surprising, but consistent I think, given
one can match on any particular field.

cheers,
Pádraig.

Reply via email to