IT 244: Introduction to Linux/Unix
Quiz 10 Answers

  1. In a for ... in loop, where does the loop variable get its values?
    from the list of values following the keyword in
  2. In a simple for loop, where does the loop variable get its values?
    from the command line arguments
  3. When does a while loop stop running?
    when the command following while returns an exit status that is not 0
  4. What does the continue command in a loop do?
    stops that pass through the loop and returns to the top of the loop
  5. What does the break command in a loop do?
    jumps completely out of the loop
  6. In a case statement, what determines which block of code is executed?
    the value of the variable between case and in
  7. How do you mark the end of a code block in a case statement?
    ;;
  8. What signals the end of a pattern in a case statement?
    )
  9. What meta-characters can you use in a case statement pattern?
    all of them: ?, * and [  ]
  10. What pattern would you use in a case statement if you wanted to match 11, 12 or 13?
    11|12|13