sh/bash/util.sh
2024-11-12 10:25:44 +01:00

21 lines
285 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 "%s" "${prompt}" 1>&2
read -r -s secret
echo >&2
echo "${secret}"
unset secret
}