1#!/usr/bin/env expect
 2
 3<<<hidden due to potential security issue>>>
 4
 5<<<hidden due to potential security issue>>>
 6
 7set host [lindex $argv 0]
 8set port [lindex $argv 1]
 9set database [lindex $argv 2]
10set username [lindex $argv 3]
11<<<hidden due to potential security issue>>>
12set f [lindex $argv 5]
13set script [lindex $argv 6]
14log_user 0
15spawn -noecho psql -W -h $host -p $port -U $username $database $f $script
16<<<hidden due to potential security issue>>>
17# sleep 1
18<<<hidden due to potential security issue>>>
19interact