CSc 3320: Final/Project solved




5/5 - (3 votes)

1. [30pts] Copy the contents of this document into a text file. Make sure the
spacings and indentations are included.
Write a C program that reads the text file and then outputs
— the number of characters (space is to be considered a character),
— number of words (a word is any sequence of non-white-space characters),
— number of lines.

Write a makefile as well.
2. Repeat question 1, but write a shell script instead of C. Makefile not
necessary. [30pts]

3. [40pts] Describe (briefly in 1-2 sentences) the following unix utility functions
and provide 1 example of it’s usage. You can refer to Chapter 13 in the Unix
textbook. You must NOT provide the same example from the textbook:
a. perror()
b. open()
c. read()
d. write()
e. lseek()
f. close()
g. monitor()
h. chown()
i. fchown()
j. chmod()
k. fchmod()
l. link()

m. unlink()
n. getpid()
o. getppid()
p. fork()
q. exit()
r. wait()
s. alarm()
t. signal()
u. kill()
v. pipe()
w. scp() (also referred to as secure copy)