[comp.unix.questions] Terminal emulator for 6386 under UNIX

avr@mtgzz.att.com (a.v.reed) (01/08/89)

In article <9877@drutx.ATT.COM>, csr@drutx.ATT.COM (Steve Roush) writes:
>    For strictly interactive use, I use "cu". ....
>   I do not know of any UNIX programs outside of AT&T that allow scripting
> of sessions as can be done under DOS.

Oh yes you do, unless you've never heard of "tee".
Here is how you use tee to "script" a cu session:

$ cu <arguments to cu> | tee -ia script.out

And here is how you script a local sh session:

$ tee -ia script.out | sh -is 2>&1 | tee -ia script.out

			Adam Reed (avr@mtgzz.ATT.COM)

les@chinet.chi.il.us (Leslie Mikesell) (01/10/89)

In article <4861@mtgzz.att.com> avr@mtgzz.att.com (a.v.reed) writes:
>
>In article <9877@drutx.ATT.COM>, csr@drutx.ATT.COM (Steve Roush) writes:
>>    For strictly interactive use, I use "cu". ....
>>   I do not know of any UNIX programs outside of AT&T that allow scripting
>> of sessions as can be done under DOS.
>
>Oh yes you do, unless you've never heard of "tee".
>Here is how you use tee to "script" a cu session:

I suspect the concept of "script" here was a control file of commands
(dial/send/expect/delay/capture/etc.) not just a log of the session.
Kermit has a script command that is useful for logging in automatically
but it needs a little work to handle a complete session unless the other
end also has a kermit (main problem is the max length of time it will
wait for an expected response).

It would be nice if cu would let you execute things that look like
Dialer scripts at arbitrary times.

Les Mikesell

guy@auspex.UUCP (Guy Harris) (01/10/89)

 >And here is how you script a local sh session:
 >
 >$ tee -ia script.out | sh -is 2>&1 | tee -ia script.out

Didn't work very well at all when I tried running "vi"....

pjh@mccc.UUCP (Pete Holsberg) (01/10/89)

In article <4861@mtgzz.att.com> avr@mtgzz.att.com (a.v.reed) writes:
=
=In article <9877@drutx.ATT.COM>, csr@drutx.ATT.COM (Steve Roush) writes:
=>    For strictly interactive use, I use "cu". ....
=>   I do not know of any UNIX programs outside of AT&T that allow scripting
=> of sessions as can be done under DOS.
=
=Oh yes you do, unless you've never heard of "tee".
=Here is how you use tee to "script" a cu session:

I wondewr if the original poster wasn't talking about writing scripts
that "drive" cu, the way that MSDOS programs such as ProYAM and ProComm
have scripts that make the call, log you on, download messages, upload
files, etc., without human intervention.  I's certainly like to see how
to do that.

Pete

-- 
Pete Holsberg                   UUCP: {...!rutgers!}princeton!mccc!pjh
Mercer College			CompuServe: 70240,334
1200 Old Trenton Road           GEnie: PJHOLSBERG
Trenton, NJ 08690               Voice: 1-609-586-4800

wtm@neoucom.UUCP (Bill Mayhew) (01/11/89)

The lastest versions of kermit have added a modicum of scripting
potential somewhat akin to the expect-send chat scripts used in
uucp Systems and/or Dialers files.

We bought the 9-track source tapes for kermit from Columbia U.
They have make files and source for amlost any imaginable computer
system; Unix or otherwise.  I would imagine that you could grab
Kermit via anonymous FTP, but I'm not sure which mahcine it is on.
The Sys V kermit should compile on the 6386 with little or no
changes required.


--Bill
wtm@impulse.UUCP

wilkes@mips.COM (John Wilkes) (01/12/89)

In article <1454@neoucom.UUCP> wtm@neoucom.UUCP (Bill Mayhew) writes:
>
>The lastest versions of kermit have added a modicum of scripting
>potential somewhat akin to the expect-send chat scripts used in
>uucp Systems and/or Dialers files.

This kermit feature is useful for auto-login sequences and the like, but it
does not work for downloading significant amounts of data using simple
capture.  The maximum timeout interval you can specify is a two digit
number of seconds.  I've considered modifying the kermit sources to allow a
maximum timeout of 999 seconds, but I haven't tried it yet.

I regularly download data from a computer system that does not offer kermit
protocol.  Currently, I am using kermit and the "log session to file"
feature, but I must do it manually.  I'd like to automate this process with
some sort of scripting.

-wilkes
-- 
-- work: {decwrl ames pyramid prls}!mips!wilkes  -OR-  wilkes@mips.com

avr@mtgzz.att.com (a.v.reed) (01/12/89)

In article <563@mccc.UUCP>, pjh@mccc.UUCP (Pete Holsberg) writes:
> In article <4861@mtgzz.att.com> avr@mtgzz.att.com (a.v.reed) writes:
> =
> =In article <9877@drutx.ATT.COM>, csr@drutx.ATT.COM (Steve Roush) writes:
> =>    For strictly interactive use, I use "cu". ....
> =>   I do not know of any UNIX programs outside of AT&T that allow scripting
> => of sessions as can be done under DOS.
> =
> =Oh yes you do, unless you've never heard of "tee".
> =Here is how you use tee to "script" a cu session:
> 
> I wondewr if the original poster wasn't talking about writing scripts
> that "drive" cu, the way that MSDOS programs such as ProYAM and ProComm
> have scripts that make the call, log you on, download messages, upload
> files, etc., without human intervention.  I's certainly like to see how
> to do that.

Fair enough - I was thinking of the (clearly redundant) BSD "script".
Here is what you want from standard UNIX tools. Let "dialog.cu" be a
shell script to do your thing. It "read"s from cu and "echo"s to it,
and after doing its job lets you continue by doing

	cat -u < $TTY &
	exec cat -u > $TTY

Start your session like this:

	TTY=`tty`
	export TTY
	mknod tocu p
	mknod fromcu p
	dialog.cu <fromcu >tocu &
	cu <tocu >fromcu

You can be more elaborate and check the fifos first and remove them
afterward etc., but I think the above should be enough to get you
started.
			Adam Reed (avr@mtgzz.ATT.COM)

cspencer@spdcc.COM (Cliff Spencer) (01/12/89)

In article <4877@mtgzz.att.com> avr@mtgzz.att.com (a.v.reed) writes:
>In article <563@mccc.UUCP>, pjh@mccc.UUCP (Pete Holsberg) writes:
>Fair enough - I was thinking of the (clearly redundant) BSD "script".
>Here is what you want from standard UNIX tools. Let "dialog.cu" be a

I don't think script is "clearly redundant". Script runs the subshell
under a pty, so programs think they are on a terminal. I don't imagine
you can achieve the same effect with pipes.
					-cliff

pjh@mccc.UUCP (Pete Holsberg) (01/14/89)

In article <2412@spdcc.SPDCC.COM> cspencer@ursa-major.spdcc.COM (Cliff Spencer) writes:
=In article <4877@mtgzz.att.com> avr@mtgzz.att.com (a.v.reed) writes:
=>In article <563@mccc.UUCP>, pjh@mccc.UUCP (Pete Holsberg) writes:
=>Fair enough - I was thinking of the (clearly redundant) BSD "script".
=>Here is what you want from standard UNIX tools. Let "dialog.cu" be a
=
=I don't think script is "clearly redundant". Script runs the subshell
=under a pty, so programs think they are on a terminal. I don't imagine
=you can achieve the same effect with pipes.
=					-cliff

Watch your attributions, cliff.  I didn't say that!

Pete

-- 
Pete Holsberg                   UUCP: {...!rutgers!}princeton!mccc!pjh
Mercer College			CompuServe: 70240,334
1200 Old Trenton Road           GEnie: PJHOLSBERG
Trenton, NJ 08690               Voice: 1-609-586-4800