In Expect script, how do you prompt user without writing to stdout? Is it possible to prompt the user through stderr?
I have a script written in Perl to automate some testing using ssh. In order to automate login for ssh, I wrapped the ssh command using Expect, but sometimes the password for ssh expires mid-way in executing the code (e.g rsa token refreshes every 30seconds).
I found this: How can I make an expect script prompt for a password?
which works great, except it prompts the user through stdout. My Perl script reads and parses the stdout.
I would like to abstract this to my Expect script without modifying the Perl code, is it possible?
Edit: I just realized my use case is stupid since I'm not sure how Perl will be able to interact with the Expect script prompt since I'm calling the Expect script from Perl. :/ But it would still be good to know if it's possible to Expect to write to stderr. :D
Thanks!