sh/bash/util.sh
2024-11-12 09:28:08 +01:00

21 lines
280 B
Bash

not() {
case "${1}" in
"false") echo "true" ;;
"true") echo "false" ;;
*) ;;
esac
}
read_passphrase() {
read_secret "PassPhrase: "
}
read_secret() {
local prompt="${1}"
local secret
printf "${prompt}" 1>&2
read -r -s secret
echo >&2
echo "${secret}"
unset secret
}