On Wed, 28 Nov 2001, Tom Lane wrote:
> >> Is there a safe way to send username and password to psql?
>
> > The standard way I know of is to use 'expect' and wrap your psql call
> > around that.
>
> Didn't you break that by making psql read the password from /dev/tty?
> Or can 'expect' take control of /dev/tty?
Expect sets up a pty:
$ tty
/dev/pts/6
$ cat script.exp
spawn tty
expect eof
$ expect -f script.exp
spawn tty
/dev/pts/5
Matthew.