Questions

  1. Assume that you have the following file:
Welcome to shell scripting.
I love shell scripting.
shell scripting is awesome.

Say you run the following command:

$ awk '/awesome$/{print $0}' myfile

How many lines will be printed in the output?

  1. How many lines will be printed if we use the following command against the previous file?
$ awk '/scripting\..*/{print $0}' myfile
  1. How many lines will be printed if we use the following command against the previous sample file?
$ awk '/^[Ww]?/{print $0}' myfile
  1. What is the output of the following command?
$ echo "welcome to shell scripting" | sed -n '/Linux|bash|shell/p'