Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

24 lines
459B

  1. #!/bin/sh
  2. i=0
  3. while read command
  4. do
  5. i=$((i+1))
  6. if test ${i} -ge 12345; then
  7. echo "quit"
  8. elif test "${command}" = 'bye'; then
  9. exit
  10. elif test "${command}" = 'bet?'; then
  11. echo 1
  12. elif test "${command}" = 'insurance?'; then
  13. echo "no"
  14. elif test "$(echo ${command} | cut -c-5)" = 'play?'; then
  15. count=$(echo ${command} | cut -f2 -d" ")
  16. if test ${count} -lt 12; then
  17. echo "hit"
  18. else
  19. echo "stand"
  20. fi
  21. fi
  22. done