bin/confirm @ 38f572e1b19b

More
author Steve Losh <steve@stevelosh.com>
date Tue, 01 Dec 2020 13:56:45 -0500
parents 32bdaee0bb8b
children (none)
#!/usr/bin/env bash

if test "$1" == ""; then
    read -p "Are you sure? " -r
else
    read -p "$1 " -r
fi

if [[ $REPLY =~ ^[Yy](es)?$ ]]
then
    exit 0
else
    exit 1
fi