Operating System - HP-UX
1827414 Members
5017 Online
109965 Solutions
New Discussion

Reding verrrrry long lines from the terminal

 
Leslie Chaim
Regular Advisor

Reding verrrrry long lines from the terminal

Hi,

I am having problems reading input from the keyboard. If the input is very long (more then 512 chars), I only get the last 512 chars from the input queue.

I looked at the termio(7) man page in the section "Input Processing an Reading Data" and it clearly states:
When the input limit is reached, all saved characters are discarded without notice.

Well, how can I get around this limitation?

For simplicity, here are simple samples of what I am trying to do. They all print only the last buffer of the input. These are all that I entered from an interactive shell:

cat
awk '{print $0}'
sed -n p # hit enter twice to see output
perl -le '$_ = <>; print'
(read line; echo $line)

For all the above, whenever there are more then 512 chars inputted, only the last set is outputted.
For the last example above I found that my problem was the EDITOR variable which was set to vi. The following works fine:

(export EDITOR=emacs; read line; echo $line)

This work perfectly, no matter how many chars are in the input.

Is it possible to have some settings (perhaps stty?), where no characters from the input will be discarded?

Thanks in advance,

--Leslie


If life serves you lemons, make lemonade