CS 2304--UNIX: Assignment 5

Due Wednesday, Apr. 9, by 5pm

80 Points




Writing A Shell Script

Your assignment is to write a simple shell script called whereami. When invoked, this script will print out the user name of the current user, the name of the current machine, the full path name of the current working directory, the current time, and a listing of the contents of the current directory. Output from whereami should follow this example:

Your are         : edwards
You are on       : bohica.cs.vt.edu
Current directory: /home/edwards
The time is      : Sun Mar 30 20:18:00 EST 1997
Current directory contents:
1206-old/       bin/            invd2.dat       skel/           working/
A5.html         configs/        invd3.dat       sum3/
Bugs.txt        gnuemacs-lib/   invd4.dat       tools
Mail/           invd1.dat       nsmail/         whereami*

Remember that your shell script must start with a proper "bang line":

    #!/bin/csh -f
It should also end with a proper exit statement.

Sources For Information

Your shell script is free to access any shell or environment variables, and call any commands provided on the system. Some shell variables you might wish to explore on the csh or tcsh manual pages include:

Some commands that may also be of use are (see their respective manual pages):

Submitting Your Answers

You are to hand in your assignment by sending an email message to the address cs2304u@ei.cs.vt.edu. To receive credit, you mail message must be RECEIVED by this account by the time and date listed above. It is your responsibility to successfully submit your assignment via email.

The body of your message must be a plain ASCII text file that contains the following:

Remember that no late assignments are accepted.




Stephen Edwards <edwards@cs.vt.edu>
Last modified: Wed Apr 2 13:57:28 EST 1997