sh/bash/util.sh

22 lines
285 B
Bash
Raw Normal View History

2024-11-12 05:42:16 +00:00
not() {
case "${1}" in
"false") echo "true" ;;
"true") echo "false" ;;
*) ;;
esac
}
2024-11-12 08:28:08 +00:00
read_passphrase() {
read_secret "PassPhrase: "
}
read_secret() {
local prompt="${1}"
local secret
2024-11-12 09:25:44 +00:00
printf "%s" "${prompt}" 1>&2
2024-11-12 08:28:08 +00:00
read -r -s secret
echo >&2
echo "${secret}"
unset secret
}