added confirmation helper

pull/3/head
kevin zhuang 5 years ago
parent d8727c7346
commit 3fca553dae

@ -0,0 +1,16 @@
#!/bin/bash
#
# confirmaiton helper
#
# @params
# Globals
# ${confirm}: y/n the result of the confirmation
# Arguments
# $1: message to show
function get_confirmation() {
unset confirm
while [[ "${confirm}" != 'y' && "${confirm}" != 'n' ]]; do
read -p "$1(y/n): " confirm
done
}
Loading…
Cancel
Save