CSCI 211: Unix Lab
Homework 5
(Due March 7, 2016, 23:59:59PM)

Note: 
1.	You must rely on UNIX commands only to solve the problems. No manipulation on Windows is allowed (such as scrolling the PuTTY screen). 
2.	A line of commands involving pipe ('|') or with ';' is not considered a single command.
3.	You must preform the check-in and check-out operation for each problem as specified below. Without that, no credit will be given.

Before doing the homework:

Run the command "source /lab5/quiz/prep.sh" exactly once.

Before doing EACH problem:
Run the command "source /lab5/quiz/checkin.sh <n>" exactly once, where <n> is the problem number.

After doing EACH problem:
Run the command "source /lab5/quiz/checkout.sh <n>" exactly once, where <n> is the problem number. 

After finishing all the problems:
1.	Run the command "source /lab5/quiz/wrapup.sh" exactly once. 
2.	Submit this file with your answers.
Save this file as yourlastname_yourfirstname_Lab5.rtf and then submit online at http://www.networks.howard.edu/lij/courses/2016/211/

Problems:
All the following operations should be performed in the directory tree rooted at '~/lab5' unless specified otherwise.

1.	Create two symbolic links named 'weed' and 'herb' respectively, to the file named 'grass' under the 'yard' directory.
Command(s) used:

2.	Find out the average number of characters per line in the file 'weed'.
Command(s) used:
Average number of words per line:

3.	Using one single command, find the programs of which the name starts with 'b' and ends with 'g'
Command used:
The absolute paths of the programs:

4.	Run the programs found in the previous step in background.
Commands used:

5.	Show the process id of the programs invoked in the previous step.
Command(s) used:
Process id and name of the programs:

6.	In order to make the file 'bluegrass' match the file 'ryegrass' (both under the 'lawn' directory), what changes need to be made?
Command used to find the difference:
Changes to be made (Use your own words to explain. Do not paste the command output here.)

7.	Find out how many lines have duplicates in the 'turf' file.
Command(s) used:
Number of lines with duplicates:

8.	Pick the unique lines from the 'turf' file and save them to the 'newturf' file.
Command(s) used:

9.	Sort the file 'newturf' by the first field alphabetically and case-insensitively. Show the third line in the sorted result.
Command(s) used:
Third line in the sorted result:

10.	Sort the file 'newturf' by the second field numerically, ignoring the leading spaces and the first two non-space characters, and then by the first field alphabetically and case-insensitively in the reversed order. The delimiter is ';'. Show the third line in the sorted result.
Command(s) used:
Third line in the sorted result:

11.	Terminate all the background processes invoked in the previous steps.
Command(s) used:

12.	Remove all the symbolic links in the previous steps.
Command(s) used: