Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

24 linhas
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