I didn't read what the user required exactly to begin with, but in expect
you do not necessarily need to store the password in clear text as the
interact command built in allows you to take control over where you specify.
Of course, this takes away from the initial intent to fully automate tasks.

Very small, easy example (I use this to quickly gather stats from various
security devices):

#!/usr/bin/expect --

set i [lindex $argv 0]
stty echo
set timeout 2

"(yes/no)?" { send "yes\r" }
"Password:" { interact "x" return }
}

The example above turns the control over to the user, but when the letter
"x" is input, the control is returned back to expect to complete the script.

-H 

-----Original Message-----
From: Giancarlo Paolillo [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 02, 2006 10:29 AM
To: 'Michael W. Lucas'; 'Chester Enright'
Cc: [email protected]
Subject: RE: password on command line, or other options?

Expect will definitely help but if you're more familiar with python, it
comes with an expect-like module...

http://sourceforge.net/projects/pexpect/

Giancarlo
-----Original Message-----
From: Michael W. Lucas [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 01, 2006 9:31 PM
To: Chester Enright
Cc: Michael W. Lucas; [email protected]
Subject: Re: password on command line, or other options?

On Mon, Jan 30, 2006 at 11:12:21AM -0600, Chester Enright wrote:
> Probably using an expect script would help with that.  The problem
still
> arises that the password would still be stored in cleartext.

Expect... wow, that's a blast from the past.

Thanks for the suggestion.  I know it's not ideal, but it's better
than rsh.

==ml


-- 
Michael W. Lucas        [EMAIL PROTECTED],
[EMAIL PROTECTED]
                http://www.BlackHelicopters.org/~mwlucas/

"The cloak of anonymity protects me from the nuisance of caring." -Non
Sequitur

Reply via email to