skip@stubby.UUCP (Skip Koppenhaver) (07/21/90)
Dear Mr. Wizard: Is it possible to redirect input to a program which opens /dev/tty? For example, I am trying to redirect input to the ftam program (OSI`s bigger and better ftp :-). The problem is that when ftam prompts for the password it opens /dev/tty to read it, so standard I/O redirection doesn't cut it. I have a feeling this was intentional for security reasons. However, I need to bypass this mechanism if possible. I was able to do the same sort of thing with ftp by using the -n option and the ftp "user" command which reads the password from stdin. But ftam has no such options or commands. BTW, modifying ftam source is not an option. ====================================================================== Skip Koppenhaver | Digital Analysis Corp. | (This space is uunet!stubby!skip | 1889 Preston White Dr. | intentionally (703) 476-5900 | Reston, VA 22091 | left blank)
maart@cs.vu.nl (Maarten Litmaath) (07/21/90)
In article <330@stubby.UUCP>, skip@stubby.UUCP (Skip Koppenhaver) writes: )... )Is it possible to redirect input to a program which opens /dev/tty? This is possible if your operating system has pseudo ttys, e.g. 4.3BSD or SunOS [34].*. I have written a program that lets you do what you want, using such a pseudo terminal. Email if interested. -- "and with a sudden plop it lands on usenet. what is it? omigosh, it must[...] be a new user! quick kill it before it multiplies!" (Loren J. Miller)
jik@pit-manager.mit.edu (Jonathan I. Kamens) (07/23/90)
You should get a hold of Don Libes' "expect" package. It can be ftp'd as pub/expect.shar.Z from durer.cme.nist.gov. You need Tcl to compile it; tcl may be ftp'd as pub/tcl.tar.Z from ucbvax.berkeley.edu, or from pub/tcl.tar.Z on durer.cme.nist.gov (although that version may be older). Expect allows you to manipulate interactive processes in a shell-script sort of way even when they expect to talk to /dev/tty (it uses pty's, as someone has already suggested you use). Note: I've not used expect for anything myself, I just know about it because of correspondence with Don Libes and because I saw him present a paper about it at the most recent Usenix conference. Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8495 Home: 617-782-0710