3
0

assignment1.tests 667 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Assignments after some keywords should still work
  2. if a=1 true; then a=1 true; elif a=1 true; then a=1 true; else a=1 true; fi
  3. echo if1:$?
  4. while a=1 true; do a=1 true; break; done
  5. echo while1:$?
  6. until a=1 false; do a=1 true; break; done
  7. echo until1:$?
  8. if a=1 true
  9. then a=1 true
  10. elif a=1 true
  11. then a=1 true
  12. else a=1 true
  13. fi
  14. echo if2:$?
  15. while a=1 true
  16. do a=1 true
  17. break
  18. done
  19. echo while2:$?
  20. until a=1 false
  21. do a=1 true
  22. break
  23. done
  24. echo until2:$?
  25. if
  26. a=1 true; then
  27. a=1 true; elif
  28. a=1 true; then
  29. a=1 true; else
  30. a=1 true; fi
  31. echo if3:$?
  32. while
  33. a=1 true; do
  34. a=1 true; break; done
  35. echo while3:$?
  36. until
  37. a=1 false; do
  38. a=1 true; break; done
  39. echo until3:$?