in reply to Re^4: Automating command line utility
in thread Automating command line utility

Think about the following scenario:

There is the binary utility su, that you want to automate from a Perl script. For instance, you want to run  su -c "make install"

You write a script that just does system 'su -c "make install"'. But when you run it, it asks for a password, so you try...

open my $pipe, '| su -c "make install"'; print $pipe, "$password\n";
But it keeps asking for the password because su is reading from /dev/tty.

What do you do then?

Replies are listed 'Best First'.
Re^6: Automating command line utility
by JavaFan (Canon) on Oct 03, 2008 at 12:17 UTC
    Ah, I understand now. I though moritz was talking about having to read password in the application being written. But he was talking about whatever other program that needs to be run.

    Which makes all my comments moot.