Shell自动交互的三种方法


方法一


(echo "password";) | read input_pwd

方法二


read input_pwd << EOF

password

EOF

方法三


#!/usr/bin/expect

spawn ssh root@192.168.0.1

expect "password:"

send "123\n"

interact

一个有关“Shell自动交互的三种方法”的想法

  1. I think your website needs some fresh content. Writing manually takes a lot of time, but there is tool for this time consuming task, search for; Ssundee advices unlimited
    content for any blog

  2. I think your blog needs some fresh content.
    Writing manually takes a lot of time, but there is tool
    for this time consuming task, search for; Ssundee advices
    unlimited content for any blog

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

您正在使用您的 WordPress.com 账号评论。 登出 /  更改 )

Google photo

您正在使用您的 Google 账号评论。 登出 /  更改 )

Twitter picture

您正在使用您的 Twitter 账号评论。 登出 /  更改 )

Facebook photo

您正在使用您的 Facebook 账号评论。 登出 /  更改 )

Connecting to %s