This mail was sent on 1/29/99
Reading for next week: review chapters 4, 5, and 6 of Glass's book
please start reading chapter 7 until page 264
.

This homework set is due on 2/12/99 before class starts. Please email your homework to the TA. At this point, the TAs for this course have not been assigned and I will be sending you an email when I have that information.


Normally, you have one week to do each homework, exceptionally this time, you will have two weeks
Using the concepts introduced in the the first lecture:


1. Under what circumstances can two processes have the same a - process id?
b - parent process id?
c - process group id?

2. Why should you never specify setuid permissions and write permissions for other on the same file. Please give an example.
3. Can a file have more than one owner id? explain
Can a file have more than one group id? explain

4. In what ways can the actions of a child process affect its parent?
Please illustrate with an example.
5. Can you execute a program that is in a directory for which you do not have read permission? Please explain.
6. Answer the following file permissions questions
a- what does a file creation mask of 024 means?
b- what does the file permission 751 mean? Represent this permission as a permission string.

7. write a script named "undelete" that takes a list of pathnames,
and creates a shell program that will restore the files if they are
deleted. The script should also preserve the file permissions.
you do this by creating a here-document for each file whose pathname
is the contents of the file.

8. you have friends all over the country or the world with cumbersome e-mail addresses.
A file named .mailrc (note that a period is the first character) in your home directory, contains aliases which allow you to use natural names for your friends when you send them mail.
For example, suppose I have a friend named Frederic Siquet who works at International Paper
His address would be something like Frederic.Siquet@ip.fr
but I don't want to type that, so I put

alias frederic Frederic.Siquet@ip.fr
in my .mailrc
Once I've done that, I need type only mail frederic and the
mail will arrive. I want a quick way to put aliases into my .mailrc and retrieving them.
So, I want the following style of interface:
addmail "frederic Frederic.Siquet@ip.fr"
to add the above alias to $HOME/.mailrc and I want mymail frederic to retrieve the whole line. Please write that shell script.