#!/usr/bin/env bash confirm () { declare yn read -p " [y/N] " yn [[ ${yn,,} =~ y(es)? ]] && return 0 return 1 } confirm