Operating System - Linux
1827741 Members
3083 Online
109969 Solutions
New Discussion

Re: stty: : Not a typewriter

 
pathri
New Member

stty: : Not a typewriter

Hi,
When i write a small scrit as follows, i get the error message in subject.

sttyset=`stty -g`
exec < t
while read line
do
echo $line
done
stty $sttyset
read aa


Can somebody pls advice how to read back again from keyboard.
3 REPLIES 3
generic_1
Respected Contributor

Re: stty: : Not a typewriter

http://docs.hp.com/en/B2355-90046/ch21s04.html
this will teach you read in korn
Steve Steel
Honored Contributor

Re: stty: : Not a typewriter

Hi


Have a look at

www.shelldorado.com

Great for starting out in shells

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Simon Hargrave
Honored Contributor

Re: stty: : Not a typewriter

Your use of exec is now correct, you are replacing your entire shell. You only want to feed the contents of t into the while..do..done block, so change your code thus:

sttyset=`stty -g`
while read line
do
echo $line
done < t
stty $sttyset
read aa