Questions

  1. How many comments are in the following code?
#!/bin/bash# Welcome to shell scripting# Author: Mokhtar
  1. If we have the following code:
#!/bin/bashecho $1echo $2echo $3

And we run the script with these options:

$ ./script1.sh -a -b50 -c

What is the result of running this code?

  1. Check the following code:
#!/bin/bashshiftecho $#

If we run it with these options:

$ ./script1.sh Mokhtar -n -a 35 -p
    1. What is the result?
    2. What is the dropped parameter?

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.