TDC 368: Unix and Network Programming, Spring 08

 


Assignment 1: Unix Commands, Shell Programming and Simple C Program

 


Due: 5:30pm 14 April 2008

 

 


Assignment Description

This assignment is divided into tow parts. The first part deals with Unix commands and shell. The second part deals with writing a C program and a makefile to compile it.

 

Part(1): show how to use Unix commands or shell programs to do the following (50%):

 

a-      Delete all core or *.o programs in all directories

b-      Find and print out (in the default printer) all *.cpp programs in all directories

c-      Find any file that is been owned by user “youssef” in the system

d-      Find if a single user is logged in

e-      List all the directories and subdirectories of the current directory

f-       Give a group “read and execute” permission of all files in the current directory and subdirectories

g-      Find and terminate any program with a given name (shell)

 

Part(2): Write a C program that does the following (50%):

 

-          The program read one lines from the standard input convert any small letter to capital letter and vice versa (numbers and special characters are not changed) and print it back in to the screen. The main program is called convertMain.c and the function that does the actual conversion (converLine() ) is in another file called convertFunc.c. The program continues to execute (read, convert and write back to standard output) till the maximum number of lines specified in the command line argument is reached. If no command line argument is specified then the default is one line.

 

-          Write Makefile the will compile this program and produce “Conversion” as the executable program. The program will be executed as follows:

 

Conversion [number of lines]

 

 

Submission Procedure:

For part 1, you need to submit your answer in a simple text showing the commands and/or shell programs for each one. For part 2, you need to archive and email files as follows:

Write your name and SSN in the main program and in the README file. After cleaning your directory from objects and bin files, do the following: (Your submission must contain a Makefile and a README file that describes how to run your program). You must use the same naming convention and command line arguments as specified in the assignment description.

 

$ tar -cvf  <HawkLogin>-<SSNLast4>-hw2.tar  *

$gzip  <HawkLogin>-<SSNLast4>-hw2.tar

 

DO NOT for get to take out any binary or object files in your submission

 

Then submit this file in the assignment entry in DLWEB . Make sure That your submission is NOT corrupted befre you submit to DLWEB.

 

Grading Policy

Late penalty is 10% per day.