Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 79864

Summary: echo error using pipe command
Product: [Retired] Red Hat Linux Reporter: Pat Norris <pnorris>
Component: syslinuxAssignee: Matt Wilson <msw>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: mitr
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-10-15 18:27:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Pat Norris 2002-12-17 16:48:46 UTC
Description of problem:
If you create a shell script with a read command and echo eg just:-
read ans1
echo $ans1

then run whatever name you've called it eg try1 and do :
try1 | less

the standard input on the read statement remains hidden (although it works!)

Version-Release number of selected component (if applicable):

How reproducible:
Consistently fails !

Steps to Reproduce:
1. run shell script as stated above
Actual results:

doesn't echo input

Expected results:

should echo input !

Additional info:
doesn't seem to be related to shell chosen (ie fails in csh and bash)
or dependant on an enviroment settings !

Comment 1 Miloslav Trmac 2002-12-18 16:46:19 UTC
That is right. less certainly doesn't want to show you your keystrokes,
so it disables echo. The terminal state is global, not per-process,
so echo is disabled for the shell script too.
To do what you probably want,
replace (the equivalent of) (read x; echo $x)|less
with read x; (echo $x |less)