I'd suggest using `contrib/bitrpc/bitrpc.py walletpassphrase`, it asks for the password in a secure way that won't end up in history and won't be visible by passers-by.