[comp.sys.ibm.pc.rt] CU: questions on using cu

moore@emily.uvm.edu (Bryan Moore) (05/03/91)

I am using the 'cu' command to connect to a modem and dial
a remote system. An example of one of the commands I might be
using is 'cu -s2400 8021234567' where 2400 is the bps, and
8021234567 is the phone number. I have 8 modems connected to the
system and I never know which one is going to be free, so I can't
specify at any time, when I issue the command the device with an
l flag ( -ltty18 ). So my question is, given this setup,
is there any way I can find out what device I am connected to
after I issue the cu command?

Thanks!

BRYAN R. MOORE          	    |   "Last night I had that same old dream
EMAIL: moore@uvm-gen.uvm.edu	    |    it rocked me in my sleep, it gave me
USMAIL: 12 Waybury Rd. Colchester,  |    the impression the sandman plays for 
  Vermont 05446                     |    keeps..."   Larry Norman

toma@swsrv1.cirr.com (Tom Armistead) (05/08/91)

In article <1991May3.145533.26146@uvm.edu> moore@emily.uvm.edu (Bryan Moore) writes:
>
>I am using the 'cu' command to connect to a modem and dial
>a remote system. An example of one of the commands I might be
>using is 'cu -s2400 8021234567' where 2400 is the bps, and
>8021234567 is the phone number. I have 8 modems connected to the
>system and I never know which one is going to be free, so I can't
>specify at any time, when I issue the command the device with an
>l flag ( -ltty18 ). So my question is, given this setup,
>is there any way I can find out what device I am connected to
>after I issue the cu command?
>
>Thanks!
>
>BRYAN R. MOORE          	    |   "Last night I had that same old dream
>EMAIL: moore@uvm-gen.uvm.edu	    |    it rocked me in my sleep, it gave me
>USMAIL: 12 Waybury Rd. Colchester,  |    the impression the sandman plays for 
>  Vermont 05446                     |    keeps..."   Larry Norman

You can use cu in debug mode.  Seems to me that this shows the tty device that
cu connects to?

Ex. $ cu -d -s2400 8021234567

Tom
-- 
Tom Armistead - Software Services - 2918 Dukeswood Dr. - Garland, Tx  75040
===========================================================================
toma@swsrv1.cirr.com                {egsner,letni,ozdaltx,void}!swsrv1!toma

eravin@panix.uucp (Ed Ravin) (05/08/91)

There's also a debug subcommand, somewhere in the ~ escapes -- I forget
it offhand, but RTFM and it'll be there somewhere.  It shows you the file
flags and lots of other good stuff.
-- 
Ed Ravin            | I'm sorry, sir, but POSTAL REGULATIONS don't allow
cmcl2!panix!eravin  | PLASTIC tape over PAPER tape and NYLON cord on an
philabs!trintex!elr | 86 inch girth to LITHUANIA...
+1 914 993 4737     |

robin@pensoft.uucp (Robin Wilson) (05/12/91)

In article <1991May3.145533.26146@uvm.edu> moore@emily.uvm.edu (Bryan Moore) writes:
)
)I am using the 'cu' command to connect to a modem and dial
)a remote system. An example of one of the commands I might be
)using is 'cu -s2400 8021234567' where 2400 is the bps, and
)8021234567 is the phone number. I have 8 modems connected to the
)system and I never know which one is going to be free, so I can't
)specify at any time, when I issue the command the device with an
)l flag ( -ltty18 ). So my question is, given this setup,
)is there any way I can find out what device I am connected to
)after I issue the cu command?

Have you tried: "~! tty"  ?
+-----------------------------------------------------------------------------+
|The views expressed herein, are the sole responsibility of the typist at hand|
+-----------------------------------------------------------------------------+
|UUCP:     pensoft!robin                                                      |
|USNail:   701 Canyon Bend Dr.                                                |
|          Pflugerville, TX  78660                                            |
|          Home: (512)251-6889      Work: (512)343-1111                       |
+-----------------------------------------------------------------------------+

rg@gandp (Dick Gill) (05/14/91)

In article <1991May11.201913.20504@pensoft.uucp> robin@pensoft.uucp (Robin Wilson) writes:
>In article <1991May3.145533.26146@uvm.edu> moore@emily.uvm.edu (Bryan Moore) writes:
>)
>)I am using the 'cu' command to connect to a modem and dial
... remote system. An example of one of the commands I might be
>)is there any way I can find out what device I am connected to
>)after I issue the cu command?
>
>Have you tried: "~! tty"  ?

This will, I think, give you the tty of your terminal, not the modem.
Although I have not tried it on an RS/6000, I suspect that you
can get the handle you want from the lock files in /usr/spool/locks
(or the RS/6000 equivalent).
-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Dick Gill     Gill & Piette, Inc.             (703)761-1163  ..uunet!gandp!rg

  

robin@pensoft.uucp (Robin Wilson) (05/16/91)

In article <354@gandp> rg@gandp.UUCP (Dick Gill) writes:
>In article <1991May11.201913.20504@pensoft.uucp> robin@pensoft.uucp (Robin Wilson) writes:
>>In article <1991May3.145533.26146@uvm.edu> moore@emily.uvm.edu (Bryan Moore) writes:
>>)is there any way I can find out what device I am connected to
>>)after I issue the cu command?
>>Have you tried: "~! tty"  ?
>This will, I think, give you the tty of your terminal, not the modem.
>Although I have not tried it on an RS/6000, I suspect that you
>can get the handle you want from the lock files in /usr/spool/locks
>(or the RS/6000 equivalent).


OK, I misunderstood.  You can use "cu -d <system_name>" and this will show all
"debug" output from the connection (possibly messy), or you can do this command
from inside of "cu":

~!ps -ef | grep -v grep | grep cu

This will show you all occurances of "cu" running, and you can then use the 
PPID to figure out which one belongs to your process.  (Looking at the lock
files will work, except that you will not be able to guarantee that a specific
lock file goes with your process.)

The "cu -d" method would be the easiest, but it will also yield ugly debug text
on your screen. 


+-----------------------------------------------------------------------------+
|The views expressed herein, are the sole responsibility of the typist at hand|
+-----------------------------------------------------------------------------+
|UUCP:     pensoft!robin                                                      |
|USNail:   701 Canyon Bend Dr.                                                |
|          Pflugerville, TX  78660                                            |
|          Home: (512)251-6889      Work: (512)343-1111                       |
+-----------------------------------------------------------------------------+