Chapter 2

  1. Three

This is because the whole bash shebang is primarily a comment, so there are three lines of comment.

  1. There is no space between the option -b and its value, so it will be treated as an option.
-a-b50-c
  1. 1

Four

This is because we have five passed parameters and we use the shift to drop a parameter.

  1. 2

-n

This is because it's on the left and the shift command drops parameters from the left.

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.