On Mon, 12 Sep 2005 10:05:28 +0200
Mauro Stettler <[EMAIL PROTECTED]> wrote:

> 2005/9/12, Mauro Stettler <[EMAIL PROTECTED]>:
> > 2005/9/12, John W. Krahn <[EMAIL PROTECTED]>:

> > > > im writing a perlscript which should be able to create a cryptoloop
> > > > onto a device. the console command to do this is losetup /dev/loo0
> > > > /dev/sdb1 -e twofish-256, then i am asked for a password... the
> > > > problem is, this password is requested by the function getpass(), i
> > > > don't know how i can enter it from a perl script.
> > > >
> > > > it seems to only listen to the keyboard, how can i enter the password
> > > > from a script?
> > >
> > > That is a security feature that requires the program input/output be 
> > > connected
> > > to a TTY (terminal).  To do what you want from perl you have to connect 
> > > the
> > > program to a pseudo TTY.


You must read the message from Mr Krahn, 



> > > perldoc Expect




> now i found the module IO::Pty from cpan. with that i should be able
> to create a pseudo tty, but i don't really know how to handle it.
> 
> this didn't work:
> 
> 
> use IO::Pty;
>


Go and read the perl documentation for Expect


perldoc Expect





Owen

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to