java - How do you write to a Unix terminal from a cmd session created by Runtime.exec? -
i have cmdproc object in java uses runtime.exec-created session , handles stdin, stdout , error streams. works fine on linux, aix , windows. can send os commands , process results, including responding prompts.
however, when send "su" command expects input terminal, not stdin response its' prompt ignored.
any idea how write "appears" have come terminal?
thanks again nidhoegger. answer seems using send/expect. mean specific installation on box - hoping avoid - can create expect script on fly, store in /tmp , execute it, passing de-crypted password parameter. delete script again. working perhaps can find time dig send/expect source code (in tcl) , see if there terminal handling can ported java. efforts.
Comments
Post a Comment