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): 2.4.18-18.8.0smp How reproducible: Consistently fails ! Steps to Reproduce: 1. run shell script as stated above 2. 3. 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 !
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)