Chapter 10

  1. Nothing

You should use the variable name without the dollar sign to print it.

  1. Solution: zero

Because you should print $1 instead of $2 where $1 is the first field.

  1. The while loop should iterate with i value less than 4 not 3.
  2. 1

Because the only user that has UID less than 1 is root (UID=0), so one line will be printed.

Get Mastering Linux Shell Scripting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.