Kevin,

I am thinking out loud also, actually I am trying to remember back to the
AIX days.

There are three types of output from a UNIX system and I am sorry that I
can't remember which is which, but the following is as close as I can get.

0> Standard output
1> Errors
2> something else.

I think that your command line should look something like this.

#begin script
telnet xx.xx.xx.xx < inputfile.txt 0> outputfile.txt
#end script

The inputfile.txt would contain.

Username
Password
Do this
Do that


The outputfile.txt would contain the results.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kevin
Toppenberg
Sent: Tuesday, October 26, 2004 4:38 PM
To: [EMAIL PROTECTED]
Subject: Re: [Hardhats-members] Linux console as terminal emulator, with
scripting?


OK, I'm going to think out loud.  Please let me know
if I am off track.

In my bash script, I will need to initiate a
connection to my old (AIX) server.  We're on a VPN, so
are using telnet.

#begin script
telnet xx.xx.xx.xx
echo "goodbyte"
#end script

The above script will not show "goodbye" until after
the connection to the server is closed.  This won't
help.  So I need to somehow control the input and
output of the telnet program.  Sounds like redirection
is needed.

#begin script
telnet xx.xx.xx.xx > SomeScript < SomeScript
echo "goodbyte"
#end script

The above should launch telnet as well as SomeScript,
and put all output to SomeScript, and get all input
from the same.

But my question is, will this direct IO to a process,
or will it overwrite SomeScript as a simple text file?

Kevin


--- Kevin Toppenberg <[EMAIL PROTECTED]> wrote:

> Hello all,
> 
> I need to do some terminal scripting.  As I try to
> download old progress notes from my server, it keeps
> stopping and asking me a pointless question (1000's
> of
> times!).  I need a simple terminal script that
> enters
> "N".
> 
> I know that TeraTerm Pro will do scripting, but I
> can't get it to properly emulate an 3151 terminal
> that
> our server expects.  The bash shell, however, does
> fine: all the functions keys work as needed etc.
> 
> So I know that there is a scripting language built
> into bash.  Is there any easy to write a program
> that
> simply scans for a given phrase (i.e. "Is this the
> same patient?") and then automatically enter "N".
> And
> if not found, then stay out of the way?
> 
> Thanks
> Kevin
> 
> 
> 
>               
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We
> finish.
> http://promotions.yahoo.com/new_mail
> 
> 
>
-------------------------------------------------------
> This SF.Net email is sponsored by:
> Sybase ASE Linux Express Edition - download now for
> FREE
> LinuxWorld Reader's Choice Award Winner for best
> database on Linux.
>
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
> _______________________________________________
> Hardhats-members mailing list [EMAIL PROTECTED]
>
https://lists.sourceforge.net/lists/listinfo/hardhats-members
> 



                
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo 


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's
Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Hardhats-members mailing list [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hardhats-members



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
_______________________________________________
Hardhats-members mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hardhats-members

Reply via email to