in reply to How to execute sudo command(s) without the use of module(s)

Check if the version of sudo you are using already supports the -S flag. That would allow you to send the password through its stdin stream.

Otherwise, you will have to setup a pair of master/slave pseudo-ttys and set the slave as the child process tty. Doing that is quite OS dependent. I am not even sure it can be done without IO::Pty (that's also used by Expect under the hood).

Replies are listed 'Best First'.
Re^2: How to execute sudo command(s) without the use of module(s)
by thanos1983 (Parson) on Sep 25, 2014 at 23:03 UTC

    Hello salva,

    Interesting idea, I did think about that. I will see what I can do.

    Again thank you for your time and effort.

    Seeking for Perl wisdom...on the process of learning...not there...yet!