Anyone knows how to feed password to an application using "getpass()"?

April 16th, 2009 - 11:23 pm ET by robin | Report spam
I know getpass() reads the password from controlling terminal, but i
want to use a tool to feed the password to the application to support
automation instead of manually key in.

I tried to write password to /dev/tty when the application is waiting
for any input, but failed.

Anyone can help?

BR,
robin
email Follow the discussionReplies 3 repliesReplies Make a reply

Similar topics

Replies

#1 David Schwartz
April 17th, 2009 - 12:09 am ET | Report spam
On Apr 16, 8:23 pm, robin wrote:
I know getpass() reads the password from controlling terminal, but i
want to use a tool to feed the password to  the application to support
automation instead of manually key in.

I tried to write password to /dev/tty when the application is waiting
for any input, but failed.

Anyone can help?



Either use 'expect' or write your own application to use a pty.

DS
Replies Reply to this message
#2 David Schwartz
April 17th, 2009 - 12:09 am ET | Report spam
On Apr 16, 8:23 pm, robin wrote:
I know getpass() reads the password from controlling terminal, but i
want to use a tool to feed the password to  the application to support
automation instead of manually key in.

I tried to write password to /dev/tty when the application is waiting
for any input, but failed.

Anyone can help?



Either use 'expect' or write your own application to use a pty.

DS
Replies Reply to this message
#3 David Schwartz
April 17th, 2009 - 12:09 am ET | Report spam
On Apr 16, 8:23 pm, robin wrote:
I know getpass() reads the password from controlling terminal, but i
want to use a tool to feed the password to  the application to support
automation instead of manually key in.

I tried to write password to /dev/tty when the application is waiting
for any input, but failed.

Anyone can help?



Either use 'expect' or write your own application to use a pty.

DS
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search