我正在努力使这项工作
#!/usr/bin/expect
spawn "(psql blabla \"blabla sql;\" &> /dev/null) && (pg_restore -d xx my_file.sql &> /dev/null)"
expect "Password for user my_base: "
send "v"
但我总是得到:
spawn (psql blabla "blabla sql;" &> /dev/null) && (pg_restore -d xx my_file.sql &> /dev/null)
couldn't execute "(psql blabla "blabla sql;" &> /dev/null) && (pg_restore -d xx my_file.sql &> /dev/null)": no such file or directory
我错过了什么?