A. Van Hook writes:
> #!/usr/bin/expect
>
> set query [lindex $argv 0]
> set query [lindex $argv 1]
>
> spawn psql imdb -U hook -n
> expect "Password: ";
> send "$passwd\n ";
> expect "imdb=# ";
> send "$query;\r";
> expect "imdb=# ";
>
I have a simple script to automate sql statements: q " select * from
tablename" where q is an alias to echo "$@ ; " | psql imdb
Turning on security breaks this script since is need s password.
the new one works a before: q "select *..." passwd where q is now
an expect script:
#!/usr/bin/