Skip to content

Instantly share code, notes, and snippets.

@kgriffs
Created July 7, 2021 16:52
Show Gist options
  • Save kgriffs/ec96bb40e819c36ae4349ee82fb4125b to your computer and use it in GitHub Desktop.
Save kgriffs/ec96bb40e819c36ae4349ee82fb4125b to your computer and use it in GitHub Desktop.
Bash and ZSH prompt example including password or secret prompting
# NOTE: For zsh use:
#
# read CONTINUE"?Deploy now? [y/N]: "
# read -s PWD"?Vault password: "
#
read -p "Deploy now? [y/N]: " CONTINUE
if [[ ! $CONTINUE =~ ^[Yy]$ ]]; then
exit
fi
read -s -p "Vault password: " PWD
# ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment