I have a script which goes and finds a username, password and IP address from a keepass database (kpcli) and have a variable $ssh_info that returns output to 3 lines like this
bobuser
bobpassword
bobip
what's the best way for me in a bash script to then say take the results of the $ssh_info
ssh bobuser@bobip and then use expect to send the password
Something like
echo "$2" (bobpassword)
ssh $1@$3 (ssh bobuser@bobip)
Or even an expect script that passes the $2 (bobpassword) into the ssh $1@$3
Thanks for your help!