Assignment 4 - UNIX - Section 040
This assignment is for Section 040 - Ian Allen.
- Hand in: One telnet session log file in hard copy form from
the final step.
- You must complete the tutorials of Chapter 1 before doing Step 1 of this
You must complete the tutorials of Chapters 2 and 3 to do the rest of the
The last two sections of Chapter 3 are script projects you need to type in,
get working, and hand in as part of the telnet session log (see the last
- How to do Telnet Logging
- You need to know how to do Telnet Logging to do Step 4. When you
start telnet, select the "Start Logging" entry from the
Terminal menu. When it asks for a location for the log file, pick a
location (a folder) where you can find the log when you need to print
it! Type in some name for the log file, e.g. mylog.log.
(Use any name you like.) Conduct your Unix session. As you do
your session, everything that displays on your screen is going into the log
file. When you are done with your Unix session, again select the
Terminal menu and select "Stop Logging". Now, you can open
the log file (in the folder in which you created it) and print it.
(Remember that the log file is stored in the Windows directory in which you
created it. The log file is not stored on Unix.)
- Step 1.
- By the time you complete Chapter 1, you will have 17 to 20 or more files
listed in your home directory. After you have finished Chapter 1, create in
your Unix home directory a file named myfiles that contains the names
of all the files in your home directory. (Use a Unix command to create
this file; do not type in all the file names!)
- Step 2.
- After completing pages 89-138 in Chapter 2, start using the vi text
editor to type the answers to the following questions into the file named c1answers
in your home directory. You will find the questions in the Unix Weekly
readings and exercises web pages.
Answers to the Chapter 1 Reading Questions 1-1 through
1-9, and 1-24.
Answers to the Chapter 2 Reading Questions 2-7.
Answers to the Chapter 3 Reading Questions 3-23 through
- Put your name at the top of this file.
- Step 3.
- After reviewing Chapter 3, create a script file myscript that
contains the following:
- One or more comment lines with your name and the date
you began creating the script.
- A command to display today's date.
- A command to change the working directory to /tmp
- A command to display the current working directory.
- A command pipeline to display only the subdirectories
(no files) of your home directory.
- A command pipeline to count the number of people
currently logged in.
- A command pipeline to count the number of words in the
output of the command "man sh".
- Test your script to make sure that it works and that it generates the
- Step 4.
- You need to complete Steps 1 through 3 to do this final Step. Turn
on telnet logging to record the following Unix session on your A:
diskette or on your N: drive. Perform the following actions:
- Login to UNIX.
- Display your USER environmental variable.
- Display the contents of file myfile from Step 1.
- Display contents of file c1answers from Step 2.
- Display file myscript from Step 3 and then execute it to show
the correct output.
- Display the friends-on script file from Section 3.17 of the
text and then execute it. (Make sure it works!)
- Display the wordsUsed script file from Section 3.18 of the text
and then execute it. (Make sure it works!)
- Turn off telnet logging. Open and print the log file using
either the DOS EDIT command (on dot matrix printers) or using the Windows
Notepad or Wordpad accessories. Label and hand in this one log file.
There is only one telnet session log file to hand in. It comes
from Step 4. Do not log or hand in anything else other than the one log
file from Step 4.