CSC128 : Introduction to UNIX

Project 1

General shell programming
Specifying the shell for a script
Use of UNIX tools within a script
Setting permissions on a script
Getting user input at the command line and using that input in a test

Create an executable BASH shell script that will display a status report that contains the following information, in the order given:

  1. The text: Project 1 Report
  2. A dividing line of dashes (i.e. "---------------------------")
  3. The current date
  4. The current user
  5. A dividing line of dashes
  6. The text: CURRENT USERS:
  7. A list of the users currently logged into the machine
  8. A dividing line of dashes
  10. A list of ALL of the current user's processes running on the current machine, not just the child processes of the current shell, and no-one elses' processes.
  11. A dividing line of dashes
  12. The text: Please enter a user name to find. The program then takes user input from the command line and checks to see if the user that the person entered exists on the system. If the user does not exist, the script sends an error message that says "try again or type exit to quit". If the user types exit the program will terminate. If the user does exist on the system (all users are located in /etc/passwd), the program will finger the user and returns the information to the screen. Once the successful user was found the program will exit normally. If the user is not found the program will loop until the user either types exit or successfully enters a user name.

Grading Structure:
  • 50 points total
  • (15 pts) script named [yourusername] placed in your ~/bin directory on time.
    For instance mine would be named and would be located at ~/bin/ You will be sure that I can execute the script.
  • (10 pts) uses the BASH shell and correct syntax, and has no undesirable side effects. I should NOT be able to change this file.
  • (25 pts) correct report information

Submitting Your Finished Script:

your script must be named "
[yourusername]", and reside in YOUR bin. It must be executable by me (csit group) but not be writable by me.