summaryrefslogtreecommitdiff
path: root/bin/extra/confirm
blob: 116b468aa121ffde2610d5873bda14544e45a17b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

read_char ()
{
	old_stty_cfg=$(stty -g 2> /dev/null)
	stty raw -echo  2> /dev/null
	dd ibs=1 count=1 2> /dev/null
	stty $old_stty_cfg 2> /dev/null
}

>&2 printf "$1 "
read_char | grep -q "[yY]"