Skip to content

Instantly share code, notes, and snippets.

@sayz
Forked from gdemir/e-h.sh
Created January 21, 2011 22:34
Show Gist options
  • Save sayz/790562 to your computer and use it in GitHub Desktop.
Save sayz/790562 to your computer and use it in GitHub Desktop.
#!/bin/bash
cevir() {
local msj=$1
local default=$2
while :; do
echo $msj
read cevap
[ -z "$cevap" ] && cevap=$default
case $cevap in
[Ee]) return 0;;
[Hh]) return 1;;
*) echo "ne diyorsun anlamiyorum";;
esac
done
}
if cevir "benle misin değil misin iskoçyalı ?" "e"; then
echo "nevet"
else
echo "nayir"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment