NetBSD-Bugs archive

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

bin/44232: sort in unique numeric mode failes to distinquish 0 and <empty> in 5.1



>Number:         44232
>Category:       bin
>Synopsis:       sort in unique numeric mode failes to distinquish 0 and 
><empty> in 5.1
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 14 16:45:00 +0000 2010
>Originator:     Dr. W. Stukenbrock
>Release:        NetBSD 5.1
>Organization:
Dr. Nagler & Company GmbH
>Environment:
        
        
System: NetBSD test-s0 4.0 NetBSD 4.0 (NSW-WS) #0: Tue Aug 17 17:28:09 CEST 
2010 wgstuken@test-s0:/usr/src/sys/arch/amd64/compile/NSW-WS amd64
Architecture: x86_64
Machine: amd64
>Description:
        In NetBSD 5.1 the sort command does not distinquish between the number 
0 (zero) and an empty field anymore.
        This problem doesn't appear in 5.0.2 or earlier releases.
        This will break some scripts - as it does for our installation script 
....
>How-To-Repeat:
        do the following in a /bin/sh:

        ok_raid=" raid0 raid1 raid2 raid3 raid4 raid5 raid6 raid7 raid8 raid9 
raid10 raid11 raid12 raid13 raid14 raid15"
        echo "$ok_raid" | tr ' ' '\n' | sort -u -k1.5n | tr '\n' ' '

        You will get " raid1 raid2 raid3 raid4 raid5 raid6 raid7 raid8 raid9 
raid10 raid11 raid12 raid13 raid14 raid15".
        The "rail0" field is lost ...

        The sort command will take the first line containing 0 or <empty>.
        The command "echo 'raid0  raid1 raid2' | tr ' ' '\n' | sort -u -k1.5n | 
tr '\n' ' '" will drop the empty line
        resulting in "raid0 raid1 raid2", while "echo ' raid0 raid1 raid2' | tr 
' ' '\n' | sort -u -k1.5n | tr '\n' ' '"
        gives " raid1 raid2".

        remark: I'm still in the install-root for amd64 achitecture where I've 
stumbled over this problem. But I'm shure the
                will be no difference in the behaviour of sort in the final 
installation.
                At least up to 5.0.2 there was no difference.
                We have an own setup-script to install NetBSD that will setup 
some predefined configurations.
>Fix:
        fix the sort command - sorry no time at the moment to have a look why 
this failes since 5.1.

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index