Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (24 sloc) 316 Bytes
#!/bin/bash
ask_y_n() #$1 - question
{
echo -n "$1 [Y/N]: "
while [ 1 -eq 1 ];do
read -s -n1
case "$REPLY" in
[yY])
echo
return 0
;;
[nN])
echo
return 1
;;
esac
done
}
ask_y_n "Run it?"
if [ "$?" -eq 0 ];then
echo "User ask YES!"
else
echo "User ask NO :("
fi
You can’t perform that action at this time.