首页 > 数据库技术 > 详细

expect 运行脚本文件 执行postgres数据库操作

时间:2019-09-23 15:43:01      阅读:145      评论:0      收藏:0      [点我收藏+]
#!/bin/bash
/usr/bin/expect  << EOF
spawn /usr/local/pgsql/bin/2.sh
expect "*postgres:"
send "postgres\r"
set timeout 7200
expect eof
EOF

2.sh

#!/bin/bash /usr/local/pgsql/bin/psql -h 192.168.16.26 -p 5432 -U postgres -W -c "select delete_collection_data()" bigdata

 

expect 运行脚本文件 执行postgres数据库操作

原文:https://www.cnblogs.com/kcxg/p/11571917.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!