Skip to content

Instantly share code, notes, and snippets.

View graphicsminded's full-sized avatar

Graphics Minded graphicsminded

View GitHub Profile
@graphicsminded
graphicsminded / ask.sh
Last active July 15, 2018 20:42
Bash General-Purpose Yes/No Prompt Function ("ask")
# This is a general-purpose function to ask Yes/No questions in Bash, either
# with or without a default answer. It keeps repeating the question until it
# gets a valid answer.
ask() {
# https://djm.me/ask
local prompt default reply
while true; do