I want to write a shell + expect script that auto-fills my passwords via the LastPass CLI utility lpass
. I'm not sure how to accomplish sending the password returned by lpass
to the password input in an expect script.
The expect script so far looks something like:
# The beginning isn't important
expect -exact "\r
Please enter your username and password.\r
Username:"
send -- "my-username\r"
expect -exact "my-username\r
Password:"
send -- $(lpass show --password service\ im\ connecting\ to)
expect -exact "\r
# The rest of the expect script follows
I'm not sure how the bit in the $(...) should actually be written...