Subject: bin/12239: sort globbers output file
To: None <gnats-bugs@gnats.netbsd.org>
From: Kimmo Suominen <kim@tac.nyc.ny.us>
List: netbsd-bugs
Date: 02/18/2001 15:48:53
>Number:         12239
>Category:       bin
>Synopsis:       sort globbers output file
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Feb 18 12:49:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        2001-02-16
>Organization:
Kimmo Suominen
>Environment:
System: NetBSD nix.suominen.org 1.5S NetBSD 1.5S (GW-GENERIC) #2: Sun Feb 18 00:30:00 EST 2001 kim@nix.suominen.org:/net/nix/src-3/NetBSD/cvsroot/src/sys/arch/i386/compile/GW-GENERIC i386
Architecture: i386
Machine: i386

Also happens on NetBSD/sparc of the same date.
>Description:
Sort will overwrite existing contents of its output file descriptor.
>How-To-Repeat:
Run this script:

    #!/bin/sh
    echo x y z | tr ' ' \\012 > foo.txt
    echo a b c | tr ' ' \\012 | sort >> foo.txt

The output file will have no trace of x, y or z.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: