标签:pass inter class user echo client foo 实现 use
apt install expect
#! /bin/bash
read -p "username: " username
read -sp "password: " password
echo -en "\n" # echo
echo $username, $password
#! /usr/bin/expect
spawn ./server.sh
expect "username: "
send "foo\n"
expect "password: "
send "bar\n"
interact
./client.sh
标签:pass inter class user echo client foo 实现 use
原文地址:https://www.cnblogs.com/pkuimyy/p/12804221.html