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. This is followed by a blank line,
then a count of the number of ordinary files, executable files,
directories, and links in the current directory.
Output from whereami should follow this example:
You are : ltw You are on : cayuga.cs.vt.edu Current directory: /f/ltw/classes The time is : Fri Oct 31 10:21:16 EST 1997 Current directory contents: 1206-old/ bin/ invd2.dat skel/ working/ A5.html configs/ invd3.dat sum3/ zlink@ Bugs.txt gnuemacs-lib/ invd4.dat tools Mail/ invd1.dat nsmail/ whereami* 7 ordinary, 1 executable, 9 directories, 1 links.
Remember that your shell script must start with a proper "bang line":
#!/usr/local/bin/ksh
It should also end with a proper return statement.
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 include:
$PWD
$USER
[[ ]] (ksh)
date
for (ksh)
hostname
ls
pwd
uname
whoami
You are to hand in your assignment by sending an email message to the address cs1206@ei.cs.vt.edu. To receive credit, your 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 (remember that you will receive an auto-reply by the system when your message has been received successfully). Also, send yourself a copy for future reference. The messsage must be a plain ASCII text file, with no attachments, and in exactly the format defined below. Do not insert any extra notes or explanations.
The body of your message must be a plain ASCII text file that contains the following:
whereami shell script.
Note that you will lose points on your homework assignment for failing to follow these instructions--i.e., using an incorrect subject, failing to include your name, or failing to include any of the other required elements listed above. Also, remember that no late assignments are accepted.