Technical Communications in the Unix Environment
SESSION 4 HOMEWORK [by Bruce Overby]
You'll have to log onto the Lanminds server to complete this
homework. It involves manipulating files I've placed in each of your home
directories on the server.
-----------------------------------------------------------------
The Scenario:

You've been working with a couple of writers, and you need to go into the directory they've been working in and get some man pages ready for final production. The directory they've been working in is conveniently named "WorkSession4." During the course of this homework assignment, you will be asked for three ways the writers could improve their work. Be at the ready!


The Steps/Questions:

1. Go to your "home" directory. There you will find
a new directory called WorkSession4. Go into this
directory and view its contents, then tell me the
first sign that the technical writers who created
it forgot to do something that is helpful to others.

__________________________________________


2. If you said, "There is no README file describing
the contents of the directory," you're correct.
(If you didn't say this, you might want to go
back and correct your answer.)

At this point, do not create a README file.
First, recursively list the contents of both
subdirectories in this directory-that is, list
the contents of the subdirectories and any
subdirectories inside them.

What command did you use? __________________


3. Having seen a listing of the contents of this
directory and its subdirectories, tell me the
second sign of an error.

__________________________________________


4. If you said, "There are no README files in any of
the subdirectories under FinalManPgs," you are
correct again! (If you didn't, well, you know the
drill.)

Again, do not create any READMEs at this point.
You've by now noticed that the only directory in
this work area that has a README is the Scripts
subdirectory. Go into the Scripts subdirectory
and view the README file.

What commands did you use?

__________________

__________________



5. Looking at the README file in this directory,
(a) note down any restrictions placed on using any of the scripts [you'll use this information later in the assignment] and (b) tell me the third sign of an error or omission on the tech writers' part.

__________________________________________


6. If you said, "The descriptions in this README
file are entertaining, but they don't tell me a
much about the files in here," you're
correct.

At this point, your first job is to create some README
files so subsequent visitors to this directory
won't have the same sense of complete mystery
you're feeling right now. But, of course,
creating READMEs is a tedious process. As luck
would have it, you know there's a script
somewhere in the department that makes this job
easier. You also heard that your colleagues-the ones who created these
directories-often grab such scripts for their own
use. One of the two scripts in this directory is such a script. Given the
information you have available, determine which
of the two scripts here is for creating READMEs.

Which script is it? __________________

How did you determine this?
__________________________________________


7. Now return the level above this one (the
WorkSession4 directory).

What command did you use? __________________

8. Now try out the script you identified in 6.
above. (Remember that, to use a script, you
simply type in the name of the script-in this
case, either docme or jam_on-at the command
prompt.) Now answer the following questions:

Which script did you use? __________________

What screen output did you see?

__________________________________________

__________________________________________

__________________________________________

How did the contents of the directory change?
____________________________


9. If you used the docme script and saw two lines of
text indicating that a new README had been
created, you used the correct script and are
ready to proceed. If you used the jam_on script,
you did not choose wisely, and you must do some
cleanup before proceeding: Type the following on
the command line, then proceed:

rm -R Production

(We'll get back to the jam_on script a little
later.)

Once you've run the docme script, you'll notice
that a README file has been created in this
directory. The screen output will have told you
this, and will have asked you to "add detailed
descriptions now." Don't bother to do this now.
Since some of you are having trouble running the
vi program remotely, we'll skip that action item.
However, examine the contents of both the new
README file and the docme script itself and
answer the following questions:

What key piece of information can you glean from
this bare-bones README file?

__________________________________________

Is there a common Unix command that could have
provided this information to you?

___ Y ___ N
If yes, what command? __________________

In regular English, describe two key inputs used
by the docme script:

__________________________________________

__________________________________________

In regular English, describe two key outputs
generated by the docme script:

__________________________________________

__________________________________________


10. Using the touch command, create two new files
named Xtra1 and Xtra2.

What command line(s) did you use?

__________________________________________

11. Now run the docme script again, then examine the
README. How has it changed?

__________________________________________

__________________________________________


12. Now use the docme script to create bare-bones
README files for the FinalManPgs directory and
all its subdirectories. No need to edit these
files now. You're just doing the good deed of
putting the bare-bones files in place. We'll
leave it to your two ill-trained colleagues to
fully update these files later. (Since this
activity will require repetitive use of the same
commands, be sure to use your up-arrow keys or
the history command to save yourself keystrokes.)


13. Return to top level of the WorkSession4
directory. To check that you've generated READMEs
for all the subdirectories under FinalManPgs,
construct a Unix command that will produce a
recursive listing of the contents of FinalManPgs
and send it to a file called manpg.list.

What command did you use?
__________________________________________


14. Now use the more command to examine some of the
individual files in the FinalManPgs subdirectory.
Briefly describe what kinds of files these are.

__________________________________________

__________________________________________

__________________________________________

__________________________________________


15. Now return to the Scripts subdirectory and
examine the contents of the jam_on file. At this
point, tell me the fourth sign of an error or omission
on the tech writers' part.

__________________________________________

(Sorry, I'm not giving away the answer on that
one. You'll have to figure it out for yourself.)


16. Looking at the jam_on script, list, in order of
appearance, seven Unix commands that you
recognize. (Don't include the options or
arguments to the command-just the base command
itself.)

__________________

__________________

__________________

__________________

__________________

__________________

__________________


17. Given what you see in 15 above, can you venture a
guess as to what the jam_on script is going to do
for you?

__________________________________________

__________________________________________

__________________________________________

__________________________________________


18. Do you recall, from reading the README to this
directory in Step 5 above, any restrictions
placed on the use of the jam_on script? [See the note you made.]

What is the restriction?

__________________________________________

__________________________________________

__________________________________________


Can you suggest a reason for this restriction?

__________________________________________

__________________________________________

__________________________________________


19. Per the restriction, return to the top level of
your WorkSession4 directory and run the jam_on
script. Now list the contents of the directory.
What changes have been made to the directory?

__________________________________________

__________________________________________


20. Go into the new directory and list and briefly
describe each of the files you find there.

File name: _______________________________

Description: _____________________________

__________________________________________

__________________________________________

File name: _______________________________

Description: _____________________________

__________________________________________

__________________________________________

File name: _______________________________

Description: _____________________________

__________________________________________

__________________________________________


21. Now briefly describe what the jam_on script has
done for you.

__________________________________________

__________________________________________

__________________________________________

__________________________________________


22. Now that we've run the jam_on script, we have
three files that constitute a package we need to
send to our printing vendor via ftp. These files
provide information to the printer and also
include the content the vendor will need to print
an update to our reference manuals. Remain in the
Production directory, and open an ftp connection
to the printer by entering the following command.

ftp shell.lmi.net


23. When prompted for a Name, enter the [standard user name you use for this class].


24. When prompted for a password, enter the standard
password.

(You may be wondering how we can establish a
remote connection with the system we are
currently logged into. Well, with Unix and the
Internet, we can. We're do this now
to simulate what it's like to
send a compressed archive of files to a remote
computer.)


25. Typically, printing vendors who accept files via
ftp will set up a directory for each customer who
sends them files. Under these directories, there
will often be specific subdirectories set up for
each project or product release. In our case,
these directories can be found in a subdirectory
named printer. Navigate to the printer directory
using the standard Unix command (which also works
during ftp sessions):

cd printer


26. Now list the files in this directory using the ls
command, just to be sure your directory has been
set up for you.


27. Once you locate your directory, cd into it and
list the files again. At this point, you may
notice output like this running across your
screen:

200 PORT command successful.
150 Opening ASCII mode data connection for file
list.
manpg.update
226 Transfer complete.
14 bytes received in 0.00084 seconds (16.30
Kbytes/s)

This is standard ftp output, which keeps you
informed as to whether your commands are being
accepted by the remote system and whether the
remote connection is still on line.


28. You should find a directory called manpg.update
in your personal directory. Navigate into this
directory, again using the standard Unix command:

cd manpg.update


29. Once you're in this directory, you're ready to
transfer your files. Before you do this, however,
you need to set your file type to binary, since
one of your files is a compressed file (ending in
.tar.Z). (Remember that text files transfer fine
over a binary connection, but binary files will
not transfer over a text connection.) To set the
file type to binary, simply type

bin


30. Now you're really ready to transfer. Since you
know you want to copy all the files from your
Production directory into the remote directory at
the printer, the command is simple. Because you
established the ftp connection from the
Production directory, you type:

mput *

(The mput command indicates a "multiple put,"
which will copy several files. The asterisk is
the wild card indicating all the files in the
directory.)


31. Once you press enter, you'll be prompted to
approve the transfer of each file. The first
prompt should be:

mput commands.list?

At each of these prompts, type y for yes.


32. Once all of the files have been transferred, type
bye to terminate the connection.