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.
- Create and run
fruits, looping over four fruit names and printing a message per value. Verify script saved and mode set as directed. - Create and run
namelistover three names, printing one per iteration. Check mode before execution. - 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.
- Independently write the loop producing the four baseball-team sentences; mark keywords and explain variable substitution.
- Write the command loop running
who,ls, andpwd. Record real output and explain dynamic components. - Trace a complete iteration table for each loop: pass number, variable value, body action/output.
- Alter one list’s size and order, predict and observe changes. Explain the relation between list length and loop repetitions.
- Review
for,in,do,done, script permissions, saving, and invocation.
Reflection: What part of this lab are you now able to predict before executing?