lastpass / lastpass-cli

LastPass command line interface tool
GNU General Public License v2.0
2.85k stars 292 forks source link

Using a variable to define name field in note. #534

Closed malamoureux closed 4 years ago

malamoureux commented 4 years ago

I would like to poll the hostname of device and use as variable to name the note. I've attempted to format in several ways but am unable to get the desired results. Is it possible to use a variable to complete the name field?

Thanks in advance.

DEVICE=$(hostname) \ echo "SSH passhprase? "; read passhprase; \ printf "Private Key: %s\nPublic Key: %s"\ "$(cat ~/.ssh/id_rsa.pub)" | \ lpass add --non-interactive \ --sync=now "${passhprase}" \ --note-type=ssh-key \ Shared-SSH_Keys/"${DEVICE}"

Returns..

Usage: lpass add [--sync=auto|now|no] [--non-interactive] [--color=auto|never|always] {--username|--password|--url|--notes|--field=FIELD|--note-type=NOTETYPE} NAME