My script needs to call multiple times a program that needs a password, which can only be passed as an environment variable. As I want to ask the user for the password only once, I've done this :
read -s PASSPHRASE
export PASSPHRASE
program some_option
program some_other_option
program yet_another_option
PASSPHRASE=""
As I understand it, the content of the PASSPHRASE
variable is only accessible to the current shell and the program
during the three calls, then the variable is reset and the passphrase isn't accessible to anyone else.
Am I right, or am I doing it wrong ?
I'm concerned about the other users on the system (excluding root
) and the other programs running on my user account.