Bug 79864 - echo error using pipe command
Summary: echo error using pipe command
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: syslinux (Show other bugs)
(Show other bugs)
Version: 7.3
Hardware: All Linux
Target Milestone: ---
Assignee: Matt Wilson
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2002-12-17 16:48 UTC by Pat Norris
Modified: 2007-04-18 16:49 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-10-15 18:27:55 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

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)

Note You need to log in before you can comment on or make changes to this bug.