Stu, If what you have to do is anything but mindlessly simple and you don't mind a bit of a learning curve, then I'd suggest using perl to drive your telnet session. EXECUTE 'SH -c "perl mytelnet.pl arg1 arg2 ... argn"' from BASIC and write yourself a perl script to drive the telnet session. There is a perl module you can download from CPAN (www.cpan.org) called Net::Telnet which takes care of pretty much everything you might want to do inside the telnet session, and if you vaguely care about the output which come back and it may be some sort of full screen application, then there is another module called Term::VT102 which you can use to grab anything you see on the telnet session and process it to produce clear text and tell you where the cursor is etc.
I know this because I'm currently working with it for a different purpose - automating benchmarking and QA scripts, and originally, I thought about using expect, but found that perl was at least as easy as expect/tcl, but far more powerful. Cheers, Ken > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Tom Firl > Sent: Friday, 29 October 2004 8:22 AM > To: [EMAIL PROTECTED] > Subject: RE: [U2][UV]telnet > > > For a variety of reasons (security being a big one), many > people think that automating a telnet client isn't a good > idea... Karl may be fishing for more information so as to > suggest an alternative solution. > > At any rate, the following has worked all right for simple > tasks on an AIX system running Universe: > > SH -c '(sleep 1; echo username; sleep 1; echo password; sleep > 5; echo "ls -l"; sleep 3; echo "exit") | telnet hostname' > > Tom Firl > Columbia Ultimate > > > -----Original Message----- > > From: Stu Glancy [mailto:[EMAIL PROTECTED] > > Sent: Thursday, October 28, 2004 2:39 PM > > To: [EMAIL PROTECTED] > > Subject: Re: [U2][UV]telnet > > > > > > What the script does is not so important just yet. How do > > you pass the > > login id and password? > > > > [EMAIL PROTECTED] wrote: > > > > >I'm not sure you've given enough information. What would the > > script do? > > >What's it for? > > > > > >I've created scripts that use ssh rather than telnet for automated > > >processes but never telnet. > > > > > >Karl > > > > > ><quote who="Stu Glancy"> > > > > > > > > >>I want to create a telnet script from a program and execute > > it. Can it > > >>be done? If it can, what would the EXECUTE look like? > > What would the > > >>script look like? I'm looking for concept and a little detail. > > >>------- > > >>u2-users mailing list > > >>[EMAIL PROTECTED] > > >>To unsubscribe please visit http://listserver.u2ug.org/ > > ------- > > u2-users mailing list > > [EMAIL PROTECTED] > > To unsubscribe please visit http://listserver.u2ug.org/ > ------- > u2-users mailing list > [EMAIL PROTECTED] > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/