Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help!! Help!!!

7 views
Skip to first unread message

ja...@lucent.com

unread,
Mar 3, 1999, 3:00:00 AM3/3/99
to
Folks,

Please give me an explanation for the problem I m having....and a
solution.

Open two terminal sessions with the same login account.

Let us say, /dev/pts/20 and /dev/pts/30.

In /dev/pts/30, type in :::


$ echo "Enter number::\c" >/dev/pts/20 ; VAR=`line < /dev/pts/20`

at the command prompt and hit return.

Now, the " line" cammand waits for input from "/dev/pts/20"

The message "Enter number" appears on /dev/pts/20. Let us say you
enter "8" and hit the return key.

I notice 3 kinds of behavior at various attempts.
1) As soon as you enter 8 and hit return in terminal /dev/pts/20,
the " line" command returns in /dev/pts/30 and VAR has value=8.
2) Sometimes you have two hit 2 returns in terminal /dev/pts/20, for
the line command in /dev/pts/30 to return.
3) Sometimes three!!

( Note:: But, whatever the case VAR gets the value 8 if I use line .
If "read" is used instead of " line" VAR does not get the value 8.)

Is there a way that I can surely get the value into the VAR variable in
/dev/pts/30 by hitting the return key in /dev/pts/20 just once
consistently?

0 new messages