What's wrong with:
read -s -r MY_PASSWORD
export MY_PASSWORD
curl -u "admin:$MY_PASSWORD" https://example.com
?
read -s -r MY_PASSWORD
export MY_PASSWORD
curl -u "admin:$MY_PASSWORD" https://example.com
?
I’d just unset histsize and histfile cars for the duration of doing sensitive stuff.
Sure, but only your user can read it. How bad is the exposure, really?
This is especially true for bridge / bastion systems that control access to internal servers. If the passwords/secrets to access the internal servers are in the history they get compromised as well.