Open in TheBrain

Practice Lab 10.10

Practice Lab 10.10 — Lab 10 Full Skills Review

Name: Date:

Instructions

Complete the whole practice worksheet in Bash, using vi as directed. Use disposable scripts. Record predictions, source code, mode, output, and explanation.

  1. Create and run fruits, looping over four fruit names and printing a message per value. Verify script saved and mode set as directed.
  2. Create and run namelist over three names, printing one per iteration. Check mode before execution.
  3. Create a loop over number words one through five. Print a sentence with the value and explain why it may not be a numeric counter.
  4. Independently write the loop producing the four baseball-team sentences; mark keywords and explain variable substitution.
  5. Write the command loop running who, ls, and pwd. Record real output and explain dynamic components.
  6. Trace a complete iteration table for each loop: pass number, variable value, body action/output.
  7. Alter one list’s size and order, predict and observe changes. Explain the relation between list length and loop repetitions.
  8. Review for, in, do, done, script permissions, saving, and invocation.

Reflection: What part of this lab are you now able to predict before executing?