Exercises on Unix Shell

Exercise 1

Given a list of telephone numbers of the form 123456789 use sed to rewrite them as (123)456-789.

Exercise 2

Use sed to select and convert all file names with suffix .html given as output by ls into capital letters with suffix .HTM. Check out command y in sed man page. An example of the expected output follows:

Exercise 3

Use sed to extract full user names from /etc/passwd/. For example:

Exercise 4

Try to solve as many levels as possible of the bandit wargame.