How to make pass read input from Bash ENV variable?

Valera Rozuvan 2c7v7czk85j3 at protonmail.com
Fri Apr 2 08:00:27 UTC 2021


On Friday, April 2, 2021 10:43 AM, Max Görner <max+passwordstore at familie-goerner.eu> wrote:

> A solution would be to be `yes`:
>
> $ PASS="super-secure"
> $ yes "${PASS}" | pass insert my_pass
>
> I hope this helps.

Thank you Max.

So, now I know that it is possible, and there are 2 ways to do this:

$ PASS="super-secure-1"
$ yes "${PASS}" | pass insert my_pass > /dev/null 2>&1
$ pass my_pass
super-secure-1
$ PASS="super-secure-2"
$ echo "${PASS}" | pass insert -m my_pass > /dev/null 2>&1
$ pass my_pass
super-secure-2

Note that I am using "> /dev/null 2>&1" to suppress extra empty lines in the output.

Regards,
Valera Rozuvan


More information about the Password-Store mailing list