"talk" in a sh script

"talk" in a sh script

Post by Brent Emerso » Wed, 07 Feb 1996 04:00:00



Geez--this group is so helpful. :)

One more simple question about sh--say I want to talk someone from within a
script and have the script wait around while I'm talking and NOT go on until
talk is done.

e.g.:

echo Do you want to talk user?
read yesorno
if [ yesorno='y' ]

fi
exit

In this example, the shell executes the talk command and then goes on, exiting
and killing the talk process before a connection could even be esablished.  How
can I make the shell wait for talk to end?

Any ideas?


"16,454 people fell in love today
go outside and walk on the dirt"
_____________________________________________________

 
 
 

"talk" in a sh script

Post by Bill Zissimopoulo » Thu, 08 Feb 1996 04:00:00


[snip]
> One more simple question about sh--say I want to talk someone from within a
> script and have the script wait around while I'm talking and NOT go on until
> talk is done.

> e.g.:

> echo Do you want to talk user?
> read yesorno
> if [ yesorno='y' ]

> fi
> exit

> In this example, the shell executes the talk command and then goes on, exiting
> and killing the talk process before a connection could even be esablished.  How
> can I make the shell wait for talk to end?

> Any ideas?

[snip]

It seems to me that the problem is the if line and not that talk is getting killed!
If you replace the line with

        if [ "$yesorno" = "y" ]

it should work.

Bill
--


http://www-dept.cs.ucl.ac.uk/students/B.Zissimopoulos/

 
 
 

"talk" in a sh script

Post by Brent Emerso » Thu, 08 Feb 1996 04:00:00


[snip]

>> echo Do you want to talk user?
>> read yesorno
>> if [ yesorno='y' ]

>> fi
>> exit
>It seems to me that the problem is the if line and not that talk is getting killed!
>If you replace the line with

>    if [ "$yesorno" = "y" ]

>it should work.

Sorry--I was just in a hurry, so I left that stuff out.  But it's in the
script, and it's NOT the problem--it receives the input with no problem and
starts to execute talk, then immediately quits.

-Brent


"16,454 people fell in love today
go outside and walk on the dirt"
-----------------------------------------------------

 
 
 

1. "talk"/"ytalk" to Sun Solaris and AIX talk daemon

Hi!

The talk and ytalk program in my linux machines won't connect to the
talk daemon in my friends accounts in Solaris and AIX. The talk program
keep waiting for "invitation", and ytalk just say that there is no talk
daemon on the destination machine. Even if my friends initiate the talk,
I cannot talk back, although I received the invitation to talk to them.

I guess this is apparent from the man page of talk:

BUGS
The version of talk(1) released with 4.3BSD uses a protocol that is        
incompatible with the protocol used in the version released with 4.2BSD
(SunOS/Solaris uses this old protocol).

That's probably the reason with the AIX, and with ytalk, too.

Well, is there any talk / ytalk for Linux that can talk "the old ways"
to a Solaris or AIX machines?

Thanks.

                                   S P Arif Sahari Wibowo
  _____  _____  _____  _____

_____/ /      /    / _____/          http://spas.8m.com/

2. Difficulty Setting Up Network

3. dowhat=`expr "dowhat.sh" : "\(.*\)\.sh$"`;

4. replacing /bin/ksh with at&t's ksh93 - problems?

5. more secure?: "#!/bin/sh -" or "#!/bin/sh"

6. FYI: Sun JDK 1.4.1/Linux

7. Is "sh file" equivalent to "cat file | sh"

8. program hang on send() ??

9. GETSERVBYNAME()????????????????????"""""""""""""

10. sh says: test "$1" = "" when $1="-b"

11. """"""""My SoundBlast 16 pnp isn't up yet""""""""""""

12. "man2ascii"-script ( was: Re: Is there a "man2ascii"-script???? )

13. CygWin - PATH finds "myscript.sh" but not "myscript"