Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 8894

Summary: pipe to read command does not work in ksh/korn
Product: [Retired] Red Hat Linux Reporter: Robert Easterling <reast>
Component: pdkshAssignee: Trond Eivind Glomsrxd <teg>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: reast
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-06-18 21:50:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Robert Easterling 2000-01-26 14:01:04 UTC
The read command does not receive the data from a pipe, e.g.

ksh-\1> echo "test" | read x
ksh-\2> echo $x

ksh-\3> read x
test
ksh-\4> echo $x
test
ksh-\5>

As you see in the second attempt without the pipe, read gets
the input string and assigns to variable x.  Both will work
on HP-UX and on SunOS.

Comment 1 Elliot Lee 2000-02-03 20:31:59 UTC
This happens with bash too, FWIW.

Comment 2 Trond Eivind Glomsrxd 2000-04-06 22:51:59 UTC
It works with zsh - the author of pdksh is aware of the problem:
http://www.cs.mun.ca/~michael/pdksh/

Comment 3 Trond Eivind Glomsrxd 2000-08-02 13:56:07 UTC
The author is of the opinion that this is undefined behaviour in the POSIX spec.
Closing.

Comment 4 Trond Eivind Glomsrxd 2000-10-31 17:52:41 UTC
*** Bug 20097 has been marked as a duplicate of this bug. ***

Comment 5 Trond Eivind Glomsrxd 2001-05-29 18:01:00 UTC
*** Bug 3200 has been marked as a duplicate of this bug. ***

Comment 6 Trond Eivind Glomsrxd 2001-05-29 18:02:03 UTC
*** Bug 42720 has been marked as a duplicate of this bug. ***