ASSIGNMENT 3

Due August 15, Noon

Purpose:

To gain experience in programming with the C-shell using shell variables, and shell commands such as foreach, and if, as well as experience with the advanced filter awk.

Assignment:

Write a C-shell script called hw3, place it into your subdirectory 20ECES620801, and make the file executable to yourself. The script expects a positive integer n as parameter. It then lists all users who are currently logged on n or more terminals with the names of the terminals from where they are logged on. If the flag -t is used then it will list the log in times instead of the terminals.  Include the current date and appropriate headings. The output should look like the following example.

 
%hw3 2
Users logged on 2 or more terminals 
Thurs Aug  8 16:47:37 EDT 2002

Username      Terminals
doejq         tty2 tty4 tty23
bermanka      ttyv3 ttyv8
lincolna      tty21 tty18 tty16 tty5 

%hw3 -t 2
Users logged on 2 or more terminals 
Thurs Aug  8 16:48:02 EDT 2002

Username      Login Times
doejq 	      Aug 8 12:34 July 31 12:45 July 28 11:10
bermanka      Aug 7 19:45 Aug 1 13:27 
lincolna      Aug 8 14:34 Aug 6 23:10 July 30 12:45 July 28 11:10