From rhh@pagesz.net  Sun Dec 13 16:59:18 1998
Received: from nina.pagesz.net (nina.pagesz.net [208.194.157.3])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id QAA05634
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 13 Dec 1998 16:59:17 -0800 (PST)
          (envelope-from rhh@pagesz.net)
Received: from stealth.dummynet. (juana-33.pagesz.net [208.213.126.33])
	by nina.pagesz.net (8.8.7/8.8.7) with ESMTP id TAA19466;
	Sun, 13 Dec 1998 19:59:57 -0500
Received: (from rhh@localhost)
	by stealth.dummynet. (8.9.1/8.8.8) id UAA05991;
	Sun, 13 Dec 1998 20:00:21 -0500 (EST)
	(envelope-from rhh)
Message-Id: <199812140100.UAA05991@stealth.dummynet.>
Date: Sun, 13 Dec 1998 20:00:21 -0500 (EST)
From: aa8vb@pagesz.net
To: FreeBSD-gnats-submit@freebsd.org
Cc: aa8vb@pagesz.net
Subject: "tr" command bug
X-Send-Pr-Version: 3.2

>Number:         9069
>Category:       bin
>Synopsis:       "tr" command bug
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 13 17:00:00 PST 1998
>Closed-Date:    Mon Dec 14 02:55:09 PST 1998
>Last-Modified:  Mon Dec 14 17:20:01 PST 1998
>Originator:     Randall Hopper
>Release:        FreeBSD 3.0-RELEASE i386
>Organization:
self
>Environment:

	Stock 3.0-RELEASE

>Description:

	Run:
	> tr -d "\004\032" | tr "[\200-\377]" "[\000-\177]"

	Type:
	a
	^D

	You should see:
	a

	You actually see:
	aD

	This seems like a bug.  Note that piping "echo 'a'" into
	this command pipe generates the correct output ("a").

>How-To-Repeat:

	See above.  Tried with tcsh and sh, so not shell-specific.
	Maybe related to stdin being a terminal.

>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: n_hibma 
State-Changed-When: Mon Dec 14 02:55:09 PST 1998 
State-Changed-Why:  
This is not a bug but  ^D printed first and then a Carriage return followed by  
a. That looks like 'aD'. 

From: Bill Fenner <fenner@parc.xerox.com>
To: aa8vb@pagesz.net
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/9069: "tr" command bug 
Date: Mon, 14 Dec 1998 14:51:08 PST

 >	Maybe related to stdin being a terminal.
 
 Right.  Try the same with "cat" -- for example, type "a^D" (with no CR)
 into "cat".  You see "aaD".  This is just because the ^D is printed as
 "^" "D" "^H" "^H".
 
 Use "echo" or some other way of taking input from somewhere other than
 the terminal if you don't want to get confused by this.
 
   Bill

From: Randall Hopper <aa8vb@pagesz.net>
To: Bill Fenner <fenner@parc.xerox.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/9069: "tr" command bug
Date: Mon, 14 Dec 1998 20:18:51 -0500

 Bill Fenner:
  |>	Maybe related to stdin being a terminal.
  |
  |Right.  Try the same with "cat" -- for example, type "a^D" (with no CR)
  |into "cat".  You see "aaD".  This is just because the ^D is printed as
  |"^" "D" "^H" "^H".
  |
  |Use "echo" or some other way of taking input from somewhere other than
  |the terminal if you don't want to get confused by this.
 
 Thanks.  Yes, a "^D" string being printed didn't occur to me.  I tried to
 this on other UNIXes and didn't see this, so I presumed to quickly that
 this might be a bug.
 
 Besides not taking input from the terminal, is there any way that you know
 of to disable printing of the "^D" when input is from the terminal?  I
 checked stty(1) with no success.
 
 Thanks,
 
 Randall
 
>Unformatted:
