Skip to content

Instantly share code, notes, and snippets.

@gdemir
Created January 20, 2011 14:36
Show Gist options
  • Save gdemir/787968 to your computer and use it in GitHub Desktop.
Save gdemir/787968 to your computer and use it in GitHub Desktop.
e-h.sh
#!/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
@gdemir
Copy link
Author

gdemir commented Jan 21, 2011

#!/bin/bash'de local msj=$1 tek satırda hatasız çalıştı hocam, local'i de anladım ona göre düzenledim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment