Linux expect接收传参

参考:

https://blog.csdn.net/vah101/article/details/83014338

 

  1.  
     
  2.  
    #!/usr/bin/expect
  3.  
     
  4.  
     
  5.  
    set host [lrange $argv 0 0]
  6.  
    set port [lrange $argv 1 1]
  7.  
    set db [lrange $argv 2 2]

执行expect脚本的命令为:

expect create_database.sh node1 5432 zz1

 
posted @ 2021-04-25 21:45  狂客  阅读(361)  评论(0编辑  收藏  举报